Commit 8acc1af
fix(stress): per-fixture hang watchdog + WaitForIdle cap raise (#431)
* fix(stress): per-fixture hang watchdog + WaitForIdle cap raise
Two race-driven flakes surfaced in the 500x selftest stress run on main
(GitHub Actions run 26513480330): 4/10000 iterations failed, with 2 of
4 in NativeDocking_* fixtures.
WaitForIdleAsync silently returned after 10 low-priority dispatcher
yields whether or not the render loop had settled. Under CI VM
contention this dropped tests onto a half-rendered tree, producing
e.g. SplitDocArea_CloseNonLast finding no `body:d1` on iter 3/500.
Raise the default cap to 50 and log a Debug.WriteLine when it hits,
so the next flake is greppable instead of silent.
The host-level HangWatchdogLoop used a global 60 s constant — equal
to EventSubscriptionLeakBaseline's own FixtureTimeout. The two raced
on the worst-case CI tick (~60 s for 200 renders + 200 reconciles)
and the watchdog won, FailFasting the shard instead of letting the
fixture's graceful timeout fire first. Make the watchdog threshold
per-fixture: max(60 s, FixtureTimeout + 30 s). The fixture's own
budget always gets first crack; dispatcher-starvation FailFast only
fires after that.
Also: bump EventSubscriptionLeakBaseline FixtureTimeout 60 → 120 s
(auto-bumps its watchdog to 150 s under the new rule), and add
heartbeat H.Check calls every 25 cycles so a future hang reveals
which loop window it lived in rather than just "no progress".
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* address CR feedback from Copilot
- WaitForIdleAsync: use RunContinuationsAsynchronously so await
continuations don't run inline on the dispatcher at Low priority
(defeating the yield loop's purpose); honour TryEnqueue failures
(queue shutdown) by completing the TCS rather than hanging.
- SelfTestRunner: publish a baseline FixtureProgress *before* calling
SelfTestFixtureRegistry.Create, so the watchdog can still attribute
a hang if construction itself blocks. Upgrade the per-fixture
threshold once FixtureTimeout is known.
- Fix misleading comments in EventSubscriptionLeakBaseline that claimed
the heartbeat H.Check calls reset the watchdog — they don't; the
watchdog uses elapsed-since-fixture-start. Heartbeats are log
breadcrumbs only.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent e19bd0f commit 8acc1af
4 files changed
Lines changed: 82 additions & 24 deletions
File tree
- src/Reactor/Hosting
- tests/Reactor.AppTests.Host/SelfTest
- Fixtures
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
881 | 881 | | |
882 | 882 | | |
883 | 883 | | |
884 | | - | |
| 884 | + | |
885 | 885 | | |
886 | 886 | | |
887 | 887 | | |
888 | 888 | | |
889 | 889 | | |
890 | | - | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
891 | 895 | | |
892 | 896 | | |
893 | 897 | | |
894 | | - | |
895 | | - | |
| 898 | + | |
896 | 899 | | |
897 | 900 | | |
| 901 | + | |
898 | 902 | | |
899 | | - | |
| 903 | + | |
900 | 904 | | |
901 | | - | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
| 912 | + | |
| 913 | + | |
| 914 | + | |
| 915 | + | |
| 916 | + | |
| 917 | + | |
902 | 918 | | |
| 919 | + | |
| 920 | + | |
| 921 | + | |
| 922 | + | |
| 923 | + | |
| 924 | + | |
| 925 | + | |
| 926 | + | |
| 927 | + | |
| 928 | + | |
| 929 | + | |
903 | 930 | | |
904 | | - | |
905 | 931 | | |
906 | 932 | | |
907 | 933 | | |
| |||
Lines changed: 14 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
525 | 525 | | |
526 | 526 | | |
527 | 527 | | |
528 | | - | |
529 | | - | |
530 | | - | |
531 | | - | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
532 | 534 | | |
533 | 535 | | |
534 | 536 | | |
| |||
547 | 549 | | |
548 | 550 | | |
549 | 551 | | |
| 552 | + | |
550 | 553 | | |
551 | 554 | | |
552 | 555 | | |
| |||
576 | 579 | | |
577 | 580 | | |
578 | 581 | | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
579 | 589 | | |
580 | 590 | | |
581 | 591 | | |
| |||
Lines changed: 4 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
19 | | - | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
20 | 22 | | |
21 | 23 | | |
22 | 24 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
56 | | - | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
57 | 59 | | |
58 | 60 | | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
59 | 67 | | |
60 | 68 | | |
61 | 69 | | |
| |||
234 | 242 | | |
235 | 243 | | |
236 | 244 | | |
237 | | - | |
238 | | - | |
239 | | - | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
240 | 250 | | |
241 | | - | |
| 251 | + | |
242 | 252 | | |
243 | 253 | | |
244 | 254 | | |
| |||
253 | 263 | | |
254 | 264 | | |
255 | 265 | | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
256 | 277 | | |
257 | 278 | | |
258 | 279 | | |
259 | 280 | | |
260 | 281 | | |
261 | | - | |
262 | 282 | | |
263 | 283 | | |
264 | 284 | | |
| |||
343 | 363 | | |
344 | 364 | | |
345 | 365 | | |
346 | | - | |
| 366 | + | |
347 | 367 | | |
348 | | - | |
349 | | - | |
350 | | - | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
351 | 371 | | |
352 | 372 | | |
353 | 373 | | |
| |||
0 commit comments