Commit b103c49
Fix flaky
Summary:
When `enableNativeEventTargetEventDispatching` is enabled, `EventTarget.js` defers handler errors via `setTimeout(0)` in `reportListenerError`, making them non-deterministically visible to a synchronous `toThrow` assertion (96.6% flakiness score). When `toThrow` misses the error, it leaks as an uncaught exception into the next test ("event timestamps"), causing a cascade failure.
Gate the `toThrow` assertion on the legacy code path where errors propagate synchronously via `rethrowCaughtError`. In the new EventTarget path, dispatch the event and drain any pending errors via `Fantom.runTask` to prevent test pollution. The core assertion (`parentHandler` called despite child error) runs in both paths.
Changelog: [Internal]
Differential Revision: D107232191EventTargetDispatching-itest error handling test1 parent 8e6dab8 commit b103c49
1 file changed
Lines changed: 9 additions & 1 deletion
Lines changed: 9 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1321 | 1321 | | |
1322 | 1322 | | |
1323 | 1323 | | |
1324 | | - | |
| 1324 | + | |
| 1325 | + | |
| 1326 | + | |
| 1327 | + | |
| 1328 | + | |
| 1329 | + | |
| 1330 | + | |
| 1331 | + | |
| 1332 | + | |
1325 | 1333 | | |
1326 | 1334 | | |
1327 | 1335 | | |
| |||
0 commit comments