ckerr

#55441: test: start the unresponsive-event hang before sending the key

Merged
Created: Oct 28, 2026, 5:24:23 PM
Merged: Oct 29, 2026, 2:45:13 AM
5 comments
Target: main

Description of Change

The suspend and no-suspend unresponsive event specs sometimes timed out on Windows ARM64 CI waiting for unresponsive.

hangAndPoke() started the page's busy loop with executeJavaScript() without waiting for it, slept 200 ms, then sent a keyDown. If the page hadn't entered the loop by then, it handled and acked the key. With no pending ack, the hang monitor never armed, and unresponsive never came.
The loop can start late for two reasons:

  • executeJavaScript() first waits for did-stop-loading, which can come after loadURL() resolves.
  • The renderer can be slow to run the script.

The page now spins in a keydown listener, installed by an awaited executeJavaScript() before the key is sent. So the key itself starts the hang and can't be acked first. The key is still unacked from the moment it is sent, so the suspend spec's timing assertion is unchanged.

The hidden-window spec's server-controlled sync XHR (#55229) isn't reused here. The simulated suspend is broadcast to the network service, whose sockets fail pending reads with ERR_NETWORK_IO_SUSPENDED, and that ends the hang.

Validation on Linux under Xvfb, with retries off:

  • Delaying the page's loop by 1 s makes main's version time out in both specs, which is the CI symptom. With this change the key's own handler starts the hang, so that race can't happen.
  • The three unresponsive event specs passed 15/15 runs with the first version of this change, and 5/5 with the final one.

Not run on Windows.

🤖 Generated with Claude Code

Checklist

Release Notes

Notes: none

Backports

44-x-y
Merged
PR Number
#55471
Merged At
Oct 29, 2026, 9:01:55 AM
Released In
Not yet
Release Date
Not yet
45-x-y
In-flight
PR Number
#55470
Waiting to be merged
46-x-y
Merged
PR Number
#55469
Merged At
Oct 29, 2026, 9:02:13 AM
Released In
v46.0.0-alpha.3
Release Date
Oct 29, 2026, 3:00:25 PM

Semver Impact

Major
Breaking changes
Minor
New features
Patch
Bug fixes
None
Docs, tests, etc.

Semantic Versioning helps users understand the impact of updates:

  • Major (X.y.z): Breaking changes that may require code modifications
  • Minor (x.Y.z): New features that maintain backward compatibility
  • Patch (x.y.Z): Bug fixes that don't change the API
  • None: Changes that don't affect using facing parts of Electron