Repository navigation
Commit 64644c3
committed
fix(test): settle the daemon's exit on its own deadline in the web shutdown lane
The daemon-exit assertion in the #1868 shutdown lane was an instantaneous
liveness read placed right after settleManagedBrowserProcesses, so it silently
borrowed the Chrome fleet's poll deadline for a condition it never polled. It
passed only while the fleet outlasted the daemon.
Nothing enforces that order. The daemon awaits the `agent-browser close` CLI's
return, never the disappearance of the Chrome pids that call reaps, and awaits
it under a teardown-budget race it walks away from on expiry — so either can
finish first, and both have been observed: macOS reaps the fleet ~13s after the
daemon, while CI once had the daemon still alive ~4.8s after the fleet and
failed the lane. A re-run of the same commit passed.
Settle both endings concurrently from the same SIGTERM, each against its own
deadline, and assert no ordering between them. The guarantee #1868 is actually
about — the fleet closed because the daemon closed it, not because
agent-browser's idle timer beat us — is held by WEB_SHUTDOWN_IDLE_TIMEOUT_MS,
not by any ordering here.
settleDaemonExit waits out the daemon's identity rather than the bare pid: a
pid the host recycles inside the 45s window is a different process, and reading
it as "the daemon is still alive" would fail this lane for the one reason it
must not — a false red. It reuses isAgentDeviceDaemonProcess and both existing
settle constants, and reports elapsed time so a deadline failure says how long
the daemon outlived its SIGTERM.1 parent ea1d6b8 commit 64644c3
1 file changed
Lines changed: 41 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
21 | 24 | | |
22 | 25 | | |
23 | 26 | | |
| |||
194 | 197 | | |
195 | 198 | | |
196 | 199 | | |
197 | | - | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
198 | 213 | | |
199 | 214 | | |
200 | 215 | | |
201 | 216 | | |
202 | 217 | | |
203 | 218 | | |
204 | | - | |
205 | | - | |
206 | | - | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
207 | 222 | | |
208 | 223 | | |
209 | 224 | | |
| |||
298 | 313 | | |
299 | 314 | | |
300 | 315 | | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
301 | 337 | | |
302 | 338 | | |
303 | 339 | | |
| |||
0 commit comments