Commit e2bc66c
committed
test(runtime-host): assert owned Host exit against the kernel's shutdown contract
Both owned-lifecycle tests asserted that a Host process had exited against a
5 s wall clock, which is shorter than the exit the kernel guarantees, and one
of them started that clock from an event the Host does not control.
`an authority-supervised Candidate exits if its launch owner is killed` waited
on `connected.connection.closed` and then gave the process 5 s. That promise is
the Client's own transport, and the Client aborts the transport when a liveness
probe goes unanswered for two seconds, so a Host that is merely busy resolves it
while still running and the exit budget starts at an unrelated moment. The Host
also cannot exit as early as the bound assumed: the owner-loss close is armed by
`launchOwnerGuard.bind(...)` only after `startExecutionRuntimeHostCandidate`
resolves, so composition startup and recovery must finish first, and the
shutdown that follows is bounded by `shutdownGraceMs` (10 s). Wait for the
process instead, with a 20 s bound that sits above that grace and below the
launcher fixture's idle grace, and keep the connection-closed assertion after
the exit, where it is a consequence rather than a gate.
The fixture's idle grace moves from 10 s to 60 s so a Candidate that exits
because it went idle can never satisfy an owner-loss bound, with an explicit
10 s first-connection deadline so a Candidate no Client reaches still exits.
`owned Host exits promptly after its first connection closes` allowed the whole
shutdown 5 s against a kernel that allows itself 10 s, and conflated the two
claims in its name. The promptness claim is the owned launch's idleGraceMs of 0
against a 30 s default, which the draining registration the kernel publishes as
its first shutdown step reports directly; the exit is a second claim, now
bounded by the kernel's grace.
Refs #4776
Generated-by: Claude Code1 parent a9307d0 commit e2bc66c
3 files changed
Lines changed: 70 additions & 8 deletions
File tree
- packages/runtime-host/src/__tests__
- fixtures
Lines changed: 7 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
36 | 42 | | |
37 | 43 | | |
38 | 44 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1916 | 1916 | | |
1917 | 1917 | | |
1918 | 1918 | | |
| 1919 | + | |
| 1920 | + | |
| 1921 | + | |
| 1922 | + | |
| 1923 | + | |
| 1924 | + | |
| 1925 | + | |
| 1926 | + | |
| 1927 | + | |
| 1928 | + | |
| 1929 | + | |
| 1930 | + | |
| 1931 | + | |
| 1932 | + | |
| 1933 | + | |
1919 | 1934 | | |
1920 | 1935 | | |
1921 | 1936 | | |
1922 | | - | |
| 1937 | + | |
1923 | 1938 | | |
1924 | | - | |
1925 | 1939 | | |
1926 | 1940 | | |
1927 | 1941 | | |
| |||
Lines changed: 47 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
26 | 31 | | |
27 | 32 | | |
28 | 33 | | |
| |||
257 | 262 | | |
258 | 263 | | |
259 | 264 | | |
| 265 | + | |
260 | 266 | | |
261 | | - | |
262 | | - | |
263 | | - | |
264 | | - | |
265 | | - | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
266 | 279 | | |
267 | 280 | | |
268 | 281 | | |
| |||
436 | 449 | | |
437 | 450 | | |
438 | 451 | | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
439 | 481 | | |
440 | 482 | | |
441 | 483 | | |
| |||
0 commit comments