Repository navigation
Description
Recorded before any rerun.
What. OpenCodeServerLifecycleTests.StartAsync_Should_Refuse_A_Non_Contract_First_Line failed in a merge-group run on
Windows, net10.0 only:
run 40405515301, job "Build & Test
(Windows)", 2026-10-26 21:42 UTC. The queue then ejected the PR under test, #662. That PR is test-only for the SSE
reader and touches nothing in the launcher or its tests.
failed StartAsync_Should_Refuse_A_Non_Contract_First_Line (15s 906ms)
[Test Failure] TimeoutException: The child-tree handshake did not complete within 15 s while waiting for the root to authenticate.
at ...Launcher.Support.ServerStartupTreeHandshake.HandshakeStep.WithinBoundAsync[T](Func`1 step, String waitingFor)
at ...Launcher.Support.ServerStartupTreeHandshake.CaptureAndAcknowledgeAsync(Boolean acknowledge, CancellationToken cancellationToken)
at ...Launcher.Support.ServerStartupTreeScenario.AwaitObservationCleanupAsync(CancellationToken cancellationToken)
at ...Launcher.Support.ServerStartupTreeScenario.CaptureFailureAsync(Func`1 cleanup)
at ...Launcher.Support.ServerStartupTreeScenario.ThrowCleanupFailures(List`1 failures)
at ...Launcher.Support.ServerStartupTreeScenario.DisposeAsync()
at ...Launcher.OpenCodeServerLifecycleTests.StartAsync_Should_Refuse_A_Non_Contract_First_Line(CancellationToken cancellationToken)
---> System.OperationCanceledException: The operation was canceled.
at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError error, CancellationToken cancellationToken)
The row passed on net11.0 and net472 in the same run, and on Linux and macOS.
Where it fails. In the scenario's disposal, not in the assertion under test. The cleanup waits for the observed child
tree to authenticate back over the handshake socket. The accept was cancelled at the 15 s bound before the root
connected.
Family:
- Flaky on Windows: StartAsync_Should_Surface_Caller_Cancellation fails in scenario disposal (handshake accept cancelled) #535: the same scenario-disposal path, where the handshake accept was cancelled. Fixed by test: the child-tree handshake names its own timeout and the step it was waiting for #536 and closed with evidence
on 2026-10-26. - Session removal can exceed its 15 s cleanup deadline on the Windows net472 leg (GetLogAsync cursor-past-tail test) #466: the Windows net472 stall that carried Flaky on Windows: StartAsync_Should_Surface_Caller_Cancellation fails in scenario disposal (handshake accept cancelled) #535's residue.
This is a new row in the same disposal path, so it looks like the same family or a sibling of it. Neither the cause
nor the rate is established yet.
Next, for the fix:
- reproduce at a measured rate in a locked loop on Windows (net10.0 first), with a CPU-load variant;
- find whether the child's root never started, never connected, or connected after the bound;
- fix at the root, with no retry, no wider bound and no quarantine.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsQueue
Activity
Blind-Striker commentedon Oct 27, 2026
A reproduction attempt, 2026-10-27, on a local Windows machine (24 logical CPUs). No hit in 280 runs.
A local loop script on master
abcf9eee, this row alone on net10.0, each run in a fresh test host:What that narrows:
(
--max-parallel-test-modules 4). That's a much more starved host than the local machine.enough. The open suspects are the full suite running in parallel on a small host (sockets, process creation, other
launcher scenarios at the same time), or something specific to the runner.
What would reproduce it, for whoever takes it next:
Hosting.Launchernamespace, or the full project, on a 4-vCPU Windows host. A CI dispatch of the Windowsleg that counts this row would be the closest match;
ServerStartupTreeHandshake, recording when the root process started, connected andauthenticated. That would show which of the three the 15 s bound fell on;
Moving on to other allocation-track work rather than blocking that track on this row.
Blind-Striker commentedon Oct 27, 2026
How to read the next hit, once #670 is in. The timeout message will end with a timeline, for example "Steps
observed done before the timeout: the root to connect back at 0.84 s; the timeout was observed 15.00 s after the
handshake began."
within the bound.
Bun.spawninFixtures/child-tree.js) before it writes thatline. So this alone can't separate a root slow after connecting from a stalled read on the test side.
observed well past 15.00 s.
A possible next step, if the next hit lands in the authenticate stage: at the timeout, record the root socket's
TcpClient.Availablebyte count. 0 means the root never wrote; above 0 means a stalled read.test(launcher): the child-tree handshake timeout names when each step…
Blind-Striker commentedon Oct 27, 2026
A correction to my previous comment. #670 now carries the byte count, and an independent review sharpened what 0
means:
stalled.
proof. A partial identity line without its newline would already be in the reader's 1,024-byte buffer, and
Availablewouldn't show it.The socket read itself is diagnostic-only. No test can build "bytes waiting while a read is pending" without a hook into
the read.
Blind-Striker commentedon Nov 3, 2026
Closing rule for flaky issues: the last CI sighting was 2026-10-26 UTC (run 40405515301). No hit since, in the 199 CI runs (203 attempts) on master, PRs and the merge queue through 2026-11-03. Eligible to close on 2026-11-09 as "not seen again, cause unknown" if nothing recurs; a hit before then restarts the window.
Blind-Striker commentedon Nov 9, 2026
Closing as not planned: not seen again, cause unknown. This follows the closing rule above.
The last CI sighting is still 2026-10-26 UTC (run 40405515301). The rule's comment covered the 199 CI runs through 2026-11-03. Since then, 109 more CI runs (112 attempts) on master, PRs and the merge queue, through 2026-11-09, show no failure of
StartAsync_Should_Refuse_A_Non_Contract_First_Lineand no child-tree handshake timeout in any failed or cancelled job. If it recurs, reopen with the run.Blind-Striker commentedon Nov 9, 2026
Seen again on 2026-11-09, so reopening under the flaky rule. A different test fails through the same child-tree handshake timeout.
StartAsync_Should_Surface_Caller_Cancellation, on both net10.0 and net11.0 (1 failure per TFM, 4198 passed)TimeoutException: The child-tree handshake did not complete within 15 s while waiting for the root to authenticate.The root connected back at 11.75 s (net10.0) and 10.37 s (net11.0), and 0 bytes were waiting unread on the root socket.The signature matches this issue's, a slow root connect-back eating most of the 15 s handshake window. The test names differ, so future scans should search for the error text "child-tree handshake did not complete" as well as the test name.
Blind-Striker commentedon Nov 9, 2026
Root cause of the 2026-11-09 sighting: a disk stall on the hosted runner, from outside the test suite.
The evidence comes from run 42636451116's artifact
test-results-Windows-1377: its TRX files and theresource-samples.csvthat CI's sampler writes. I compared it with 12 passing Windows runs, artifacts 1368 to 1389.The counters, measured.
% idle timedropped from about 98% to 0%, and 152 of 159 samples were under 5%. Write latency had a median of 356 ms and a maximum of 1,469 ms.memory\pages/secheld at about 2.5k, and available memory stayed at 6 to 8 GB.The slowdown was runner-wide, not specific to the child tree. In the same seconds, process-spawning tests that build no child tree slowed by several times their own maximum in the passing runs:
DisposeAsync_Should_End_The_Output_Readers_Without_A_Collector: 10.4 s, against a passing maximum of 0.73 s.ProcessId_Should_Stay_Readable_After_Disposal: 6.0 s, against 0.8 s.Every child-tree test in that run was slow.
Clean_Observed_Tree_When_Handshake_Failsstill passed, at 19 to 23 s against a passing maximum of 3.4 s. The tree tests break first because one 15 s handshake bound covers two cold bun starts. The root connects back, then spawns its child, and only then authenticates. Here the roots took 10.4 to 11.8 s just to connect.What it was not.
ServerProcessconstraint held: no spawner ran on the same test host as the failures.Not established. What saturated C:. That points to the runner itself, such as Defender, servicing or the VM's storage, but the sampler records no per-process I/O.
The 2026-10-26 sighting (run 40405515301) can't be checked the same way, because its CSV has expired. Its in-process net472 co-failure, a 5 s bound that took 8.7 s, suggests a host-wide stall there too; that is inferred.
Outcome.
Blind-Striker commentedon Nov 24, 2026
Closing under the flaky-issue rule: not seen again, cause unknown.
The last sighting was on 2026-11-09 UTC, in run 42636451116 (merge group for #810, Build & Test (Windows),
StartAsync_Should_Surface_Caller_Cancellation). Its traced cause was a disk stall on the hosted runner. The 14-day window ended on 2026-11-23.The scan, 2026-11-24:
StartAsync_Should_Refuse_A_Non_Contract_First_Line,StartAsync_Should_Surface_Caller_Cancellation, and the textchild-tree handshake did not complete. The only match is the 2026-11-09 sighting run itself.The tests and their bounds stay as they are. The next hit reopens this issue and restarts the window. The disk-stall comparison above (the run's TRX and
resource-samples.csvagainst passing Windows runs) is the first thing to repeat on that hit.