Skip to content

Keep a CLI call from waiting forever on a lost HTTP/2 response, and make test-job hangs and load failures attributable - #470

Merged
davidalucas merged 12 commits into
mainfrom
467-cli-test-hang
Nov 28, 2026
Merged

davidalucas merged 12 commits into
mainfrom
467-cli-test-hang

Conversation

@davidalucas

@davidalucas davidalucas commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

Refs #467

Three different failures of the 2026 test job each have a mechanism that was reproduced or traced locally. Whether that mechanism also caused the hosted failure is inferred in each case, because none of the hosted runs recorded the evidence. One of the mechanisms is a product fault in Briosa.Cli, reported here before it is changed, in its own commit (347dbb2) so it can be reviewed or dropped on its own.

Hosted symptom Mechanism shown locally Hosted cause Changed
1. Briosa.Cli.Tests hung until the job limit (46137711305) ASP.NET Core 10.0.15 HTTP/2 defect dotnet/aspnetcore#70124: a completed response is never sent, and an MP call has no default deadline. Reproduced 3 times, traced twice, and removed by the fix in an A/B Inferred from matching symptoms; the hosted run kept no trace Product: the CLI grants every response a stream window above its receive limit. Tests: each CLI run is bounded at 60 s
2. NoRequestValueReachesTheTrailersStatusLogsAuditOrTelemetry at Failures == 0 (46143437687) With the thread pool saturated, the bounded log drain waited 8.1 s for a thread Inferred: the timing matches the 2 s bound timing out; why the drain was late was not recorded The test (both targets) and one performance test with the same pattern give the drain its 10 s maximum; the shipped 2 s default is now pinned
3. TypedFileUiAndControlOperationTests connection reset (46148408962) A request body sent more than 5 s late made Kestrel abort the connection, with CI's exact error chain Inferred from the identical error and timing; the hosted run recorded neither body timing nor Kestrel's abort reason The seven in-process test hosts of Briosa.Server.Tests (both targets) turn Kestrel's minimum data rates off; no retry
Any future hang Every dotnet test that CI or the release workflow reaches, directly or through a script, reports a hung test host, and Verify-CiWorkflow.ps1 enforces it per invocation
Two fixture races found by the #469 review Not the cause of the locally traced hangs (see below) FakeBriosaServer fixes its reply before signalling arrival; the junction helper's child-process wait is bounded

Product fault: a call could wait until interrupted

What. The server's runtime (ASP.NET Core 10.0.15) has an HTTP/2 defect, dotnet/aspnetcore#70124 (duplicate of #53736). It was fixed by dotnet/aspnetcore#69690 and backported to .NET 10 by dotnet/aspnetcore#70100 (merged 2026-11-16), but no released runtime carries the fix yet. When the tail of a response waits on the client's stream window and a stream WINDOW_UPDATE races Kestrel's final write, a scheduling flag stays set on the pooled stream object. The next response that reuses it is then never written, and nothing is logged. #450 found the same defect behind the JavaScript conformance stall.

Why the CLI hits it. On one connection, call sends GetServerInfo, then ListCapabilities with denied operations (about 190 KB, more than the 65,535-byte default stream window), then the MP call. The MP call is the response that reuses the stream after the large listing. MP calls have no default deadline (by design), so the CLI waits until it is interrupted or the connection ends. Discovery calls have 15 s deadlines and are not at risk. The real server runs the same runtime, so this is not only a test problem.

Fix (minimal). BridgeContract.ClientStreamWindowBytes = the 4 MiB receive limit + 64 KiB, set as SocketsHttpHandler.InitialHttp2StreamWindowSize in BriosaConnection. No unary response the CLI accepts (at most 4 MiB plus the 5-byte prefix) ever waits on the stream window, so that path to the defect cannot arise. This is the client-side workaround the upstream issue names. Nothing else changes: same receive limit, one connection, no retry. StreamWindowTests reads the window from the CLI's first SETTINGS frame, and the operations guide says why the window is there.

1. The Briosa.Cli.Tests hang

Reproduced locally, three times, all in DeliveryFaultMatrixTests.EveryCellOfTheDeliveryFaultMatrixKeepsTheInvariants. That test makes 664 CLI calls, each with the three-RPC sequence above, against one Kestrel fake. The hang detector named it each time.

Caught in the act, locally. A temporary hunt test (not committed) loops the matrix cells against one fake, with System.Net.Http, System.Net.Sockets and Kestrel event tracing in a ring buffer. It caught one stuck call in 4,306:

  • The fake received the MP call, produced its reply, and Kestrel logged RequestStop for stream 5.
  • The client wrote HEADERS, DATA and END_STREAM for stream 5.
  • After the listing's last frame, the client's read loop waited for bytes, and no frame for stream 5 arrived in 60 s. The listing's tail had a client stream WINDOW_UPDATE (49,150) in flight.

A second run caught the same shape. This is the upstream defect's signature.

With the fix, locally. A temporary A/B harness: eight connections each loop the listing and the MP call against the fake, and an MP call without an answer in 5 s counts as lost. The client's initial stream window is the only difference between the arms, and Briosa.slnx without the CLI tests loops beside them under the coverage collector:

Client stream window Pairs in 5 min Lost MP responses
Default, 65,535 bytes 212,342 9
The CLI's new window, 4,259,840 bytes 231,099 0

At the first arm's rate about 9.8 losses would be expected in the second, so 0 has a probability of about 6 in 100,000. The whole-CLI hunt agrees, though weakly: 1 stuck in 52,456 calls before the fix, 0 in 61,752 after.

The hosted occurrence. The hosted run has no trace, so the defect is its likely cause by match, not proof. Briosa.Cli.Tests stopped reporting, and the matrix holds about two thirds of the assembly's CLI calls.

Test side. CliRun bounds every CLI run at 60 s, and starts it on the thread pool so the bound also covers synchronous work before the CLI's first await. On a timeout it cancels a test-owned token linked to the caller's. One 30 s deadline, started before the cancellation, covers both the cancellation callbacks and the run's end, and the test still fails with the timeout. If the run has not ended by then (for example, stalled in a synchronous file flush), the failure says it was abandoned still running and may hold files it created. Later timeouts in the assembly say how many such runs are still running. In process the run cannot be stopped; only a process boundary would guarantee that it releases its files, and this harness does not build one. The streams are disposed only after the run and its cancellation have ended, and both outcomes are observed. Checked with a fake that never answers: the run failed at 60 s, was cancelled, and ended at once.

2. The log-drain assertion

BriosaLogProvider.Dispose drains the file sink on Task.Run and records one failure when drain.Wait(ShutdownTimeoutMilliseconds) (default 2000) times out.

  • Hosted: consistent with a timed-out drain. The failing test took 2.64 s; it took 0.30 s when it passed an hour earlier, so the extra time matches the full 2,000 ms wait. Dropped was 0. Failures also counts a logging or disposal exception, which would not add those 2 s, but the hosted log cannot exclude them. Why the drain was late (pool starvation or CPU contention) was not recorded.
  • Locally: the mechanism is reachable. With the pool saturated by blocked work items, Dispose waited 8.1 s before the drain got a thread (in-memory sink, 500 events). The failure did not recur in 12 whole-solution runs of main.

Changed.

  • The test (both targets) uses ShutdownTimeoutMilliseconds = 10000, the option's maximum. It still asserts Dropped == 0 and Failures == 0, now with a message, so it still fails on a dropped record, a failed sink, a value in any output, or a partial log. GeneratedClientPerformanceEvidenceTests (Performance, both targets) had the same pattern and gets the same bound.
  • ObservabilityTests.TheShippedLogDrainBoundIsTwoSeconds (both targets) pins the shipped 2,000 ms from four sources: the option's default, an empty configuration, the packaged appsettings.json, and a provider built from defaults.

Reported, not changed. The bounded drain needs a free thread-pool thread before its bound can be met. Under starvation the 2 s default can expire before the drain starts; a dedicated thread would remove that dependency. That is a product decision, so BriosaLogProvider is unchanged.

3. The connection reset

  • Hosted. The test's first call (line 118) failed after about 6 s against a 20 s deadline. The test's own loopback Kestrel host closed the connection while the client waited for response headers.
  • Reproduced locally. A request body sent 8 s late to a default Kestrel HTTP/2 host failed after 6.1 s with exactly the CI chain: HttpRequestException: An error occurred while sending the request → IOException: The request was aborted → IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host → SocketException. A body sent 3 s late succeeded. The mechanism is Kestrel's default MinRequestBodyDataRate (240 B/s after a 5 s grace), which aborts the whole HTTP/2 connection. The host's client runs in the same process, so the check measures that process's own scheduling.
  • Not established for the hosted run. GrpcTestHost clears logging providers, so neither the body timing nor Kestrel's abort reason was recorded.

Changed. GrpcTestHost.WithoutMinimumDataRates turns off MinRequestBodyDataRate and MinResponseDataRate. It is applied, one added line each, to all seven in-process Kestrel hosts of Briosa.Server.Tests in both targets. None of those hosts tests data rates, production hosting keeps Kestrel's defaults, and no call is retried.

A common factor?

Load is the most likely one; interference between assemblies was not found.

The CLI fault matrix was running during both hosted failures that can be timed from the runs' TRX files:

  • the drain failure (12:17:07.1–09.8) fell inside the matrix's 12:17:04.2–22.6;
  • the reset (13:17:35.9–42.8) fell inside the matrix's 13:17:32.9–58.7, while other tests took 6–14 s.

The matrix is the job's heaviest load: 664 calls in 18–26 s, each with a 190 KB listing, under the coverage collector, on a 4-vCPU runner shared by five test hosts.

Audit for interference:

  • Processes. No test kills processes by name; every kill is of the test's own child process tree.
  • Ports. Every in-process host binds port 0, and no CLI test connects to the default endpoint. The four pre-existing port races listed below cannot reset an established connection or hang a call.
  • Paths. Temp and results paths are per test and per assembly.

Running the assemblies one at a time. CI's parallel wall times are Server 102–108 s, CLI 51–59 s, LicensedProbes 19–23 s, Worker 11–21 s and Protocol 2–5 s. One at a time would take about 2.5–3.6 min instead of 1.2–2.8, roughly +1 to +1.5 min per target. Not recommended now: each mechanism has a fix here, and running serially would mostly hide the next load-sensitive test. Revisit it if load failures continue.

Hang diagnostics in CI

What the flags do. --blame-hang-timeout 3m is VSTest's host inactivity timer. Test starts and finishes reset it, so parallel tests can extend the time to detection, and more than one test can be unfinished when it fires. The log and the sequence file then name candidates, not necessarily one culprit. The host is ended and the step fails, unless a hang begins too close to the job limit. --blame-hang-dump-type none takes no dump. Checked locally with VSTest 18.7.1: in the project and solution form, none writes no dump, and a forced hang named the running test in the log and in the sequence file. In the DLL form, VSTest ignored none and wrote a 300 MB dump, so the upload also excludes **/*.dmp.

Every dotnet test the workflows reach, per target:

Where Invocation Hang settings Results directory (uploaded)
ci.yml source-host composition, via Test-LocalSpatialAnalyzerHost.ps1 now source-host
ci.yml Run tests (solution, Release) since bf70dbe solution
ci.yml Debug reflection and manual startup since bf70dbe debug-startup (now uploaded)
ci.yml runtime performance, via Test-RuntimePerformance.ps1 now runtime-performance
ci.yml logging pipeline, via Test-ObservabilityPerformance.ps1 now observability
release.yml Run tests and Debug startup in validate since bf70dbe not uploaded
  • Nothing else runs tests. No other workflow and no other eng script runs dotnet test or VSTest. Package smoke, client scenarios and the licensed runners start built tools, not test hosts.
  • Results directories. Each CI invocation writes its own subdirectory of artifacts/test-results, and the upload now runs after the last test step.
  • Enforcement. Verify-CiWorkflow.ps1 checks each dotnet test invocation on its own, in a step of any workflow or in an eng script. An invocation is a command line, with continuations joined and folded YAML folded, up to the next unquoted ; && || or |, or a PowerShell @("test", ...) argument array. Each must carry both settings itself, so another invocation's settings do not count. The checker does not see an invocation built from variables or splatting elsewhere, or other runners. The new Test-CiWorkflowPolicyChecks.ps1, run in CI and required by the checker, proves it on mutated copies. It rejects an invocation without the settings in a CI step, a release step, a new CI step, a step whose other command has them, a step whose other command on the same line was given them, a new workflow, each target's three scripts, a second argument array in a covered script, and a new eng script. It accepts a command continued over lines. Against the previous head, the checker names exactly the six scripts the review found.
  • Sequence file contents. A test's fully qualified name, its display name, the absolute path of its assembly on the runner, and whether it completed. Theory display names include argument values, so I audited all 474 theories in both targets:
    • 415 take only InlineData constants;
    • the other 59 take member data built from literals, enumerations, sizes and the committed operation registry;
    • a scan of those sources, with each flagged one checked by hand, found none that reads a path, the environment, the user, the clock, a GUID or random data.
      eng/security-baseline.md records this, and that a new theory should keep to it. The scan reads each source's own body, not helpers it calls.

15-minute limit: unchanged. Green 2026 jobs took 5:39–10:00; the slowest had 6:03 of setup, 2:46 of tests and 1:11 after. A hang detected after 3 minutes of inactivity ends the job by about 12.5 minutes.

release.yml. The diff is limited to one comment, the folded Run tests command, and the two flags on each of the two validate test steps. No permission, input, artifact, action, eligibility or publish logic changed.

Fixture fixes

Found by the #469 review, both in test code already on main:

  • FakeBriosaServer fixes its reply before signalling MpCallReceived, so a test that changes Reply on arrival affects only later calls.
  • SpillDirectoryTests.CreateJunction drains both pipes and waits at most 40 s in all. That is 30 s for the child to exit, then one 10 s deadline for its output to end or, after a timeout and Kill, for the exit and both pipes. The failure says which did not happen.

Neither caused the locally traced hangs. In both traced stalls the fake had already produced its reply, and every local hang was named as the fault matrix. For the one untraced hosted hang, the junction helper is only the less likely explanation.

Overlap with #445 / #469 (445-cli-mcp)

Pre-existing hazards, for a follow-up issue (not changed here)

Port races:

  1. targets/*/tests/Briosa.Server.Tests/UnaryCallAuditTests.cs:357 (ReserveLoopbackPort, used at :173, waited on at :371):
    • Race: it takes a free port from TcpListener(0), stops the listener, and the server process binds that port later. Another process can bind it in between, and WaitForListenerAsync then accepts whatever listens there.
    • Fix: start the server on port 0 and read the bound port from it, or retry a failed bind with a fresh port and confirm that the listener belongs to the started process.
  2. targets/*/tests/Briosa.Server.Tests/ManualServerStartupTests.cs:99 (ReserveLoopbackPort, used at :21, waited on at :113): the same race, with the same fix.
  3. targets/2026.1.0529.7/tests/Briosa.Cli.Tests/CallOutcomeTests.cs:444 (AnUnreachableServerIsReportedWithoutSendingAnything):
    • Race: it stops a fake and connects to that fake's port. Another process can bind the port first, and the CLI then reaches a foreign server.
    • Fix: hold a socket bound to the port without listening for the duration of the run, so connections are refused and nothing else can bind it.
  4. targets/2026.1.0529.7/tests/Briosa.Cli.Tests/SessionBindingTests.cs:20:
    • Race: it stops the first fake and starts the replacement on the same port (:22). Another process can take the port in between, and the start fails.
    • Fix: retry the replacement bind a few times on an address-in-use error, and fail with a message that names the cause.

Seen only under my local stress, not in CI:

  • UnaryCallAuditPipelineTests.WithDebugOffGrpcBuildsThePreChangeInvocationPath (UnaryCallAuditPipelineTests.cs:54) failed twice under a whole-solution loop beside a CLI loop: Assert.InRange on bytes per call with debug off, limit 0.01, actual 0.0158 and 0.0298. It is a real load sensitivity. Suggested fix: take the minimum of several measurement rounds.
  • SpatialAnalyzerSdkLifecycleTypedErrorTests. GrpcStopRacingHostShutdownReturnsTypedTrailer (asserts at :240/:245) and GrpcReconnectWithoutExecutionReadinessReturnsTypedTrailer (:217/:222) failed once each with Assert.Single on an empty trailer collection. That happened while my four concurrent hunts were exhausting the loopback port range. The empty trailers suggest a transport failure, so this is most likely an artifact of that exhaustion, not load sensitivity. I earlier described these as load failures; this corrects that.

Local verification (Windows 11, 16 logical processors, SDK 10.0.404, runtime 10.0.15, offline, under the verification lock)

Session Code Load Result
A main Briosa.slnx as CI runs it, and two CLI assembly loops, for 20 min solution 12/12; CLI 66/68, the 2 failures hangs in the matrix
B main CLI Briosa.slnx loop and a CLI loop, 13 min CLI 28/29, the failure a matrix hang; solution 6/8, the 2 failures the allocation test above
D hunt, before the fix 2 hunts and a solution loop 1 stuck call in 4,306, traced
E, F hunt, after and before the fix a solution loop without the CLI tests 0 stuck in 61,752; 1 in 52,456, traced
G window A/B harness as E 9 lost in 212,342 against 0 in 231,099
H 3754161 (the later 2bd3977 changes only eng/security-baseline.md wording) each target's CI test sequence, in ci.yml's order and with its arguments all passed: source-host, solution (2026: 56 + 415 + 445 + 361 + 1,565; 2024: 56 + 432 + 445 + 1,536), coverage summary, Debug startup, runtime performance, observability. Five results subdirectories per target, no dump. The CLI-bound cleanup check behaved as above. All four policy scripts passed, and the cross-target propagation check reports 11 changed twins and no findings
I 9cdeea1 the CLI test assembly once as CI runs it, the never-answering-fake check, the four policy scripts CLI 361/361 with coverage and hang detection, no warnings, no dump; the never-answering fake failed at 60.1 s, was cancelled and ended; all four policy scripts passed

Two of my stress arrangements (session C, and the end of session D) exhausted the loopback port range and are not evidence. By my estimate CI makes one or two thousand loopback connections in a whole job, far from that limit.

What remains uncertain

  • The hosted causes of all three symptoms are inferred, not recorded.
  • The window's effect is measured on one machine; the rate on a hosted runner was not measured.
  • The upstream abort path, for the MCP branch.
  • A CLI test run stalled in a synchronous step can outlive its test. The harness reports this, but cannot prevent it without a process boundary.

Review

GPT 6.2 Astra reviewed this pull request in three rounds.

  • Round 1 (c794ce6d). It found the product fix sound: every CLI connection offers a 4,259,840-byte initial stream window, above the 4,194,304-byte receive limit plus framing on every unary RPC; the 60-second bound is test-only; and a missing reply after dispatch is still reported as an unknown outcome. It requested hang flags on three CI test invocations that lacked them, plus the upload, wording, test-cleanup and drain-default changes described above.
  • Round 2 (2bd39773). It confirmed those resolved and requested two more changes: check each dotnet test invocation on its own in the workflow policy check, and give the CliRun timeout one deadline.
  • Round 3 (9cdeea18). It confirmed the policy check and the junction helper, and found two remaining faults in CliRun: a caller-started cancellation can hold the helper past its deadlines, and the timeout message can call a finished run abandoned.

Round 3 did not end in an approval. The maintainer decided on 2026-11-28 to merge at 9cdeea18 and track the two CliRun faults, and one minor note, in #471 (recorded in this comment). Both affect only what a test does or reports after it has already timed out, and main keeps the intermittent hang until this change lands.

🤖 Generated with Claude Code

davidalucas and others added 10 commits November 28, 2026 10:01
…tests

The 2026 test job on main ran for nine minutes with Briosa.Cli.Tests reporting
nothing until the 15-minute job limit cancelled it, so the hung test was unknown.

- ci.yml and release.yml: every dotnet test step now reports a test that runs for
  three minutes as hung (--blame-hang-timeout 3m) and ends its test host. The step
  fails well inside the job limit and the log names the test. In ci.yml the aborted
  assembly's sequence file is uploaded with the test results. No dump is taken
  (--blame-hang-dump-type none), and the upload excludes any *.dmp file in case one
  is ever written: a test host's memory is not shown to hold no secrets. Checked
  locally with VSTest 18.7.1: the project and solution form writes only the
  sequence file; the DLL form ignores "none" and writes a full dump, which is why
  the upload exclusion is there.
- Briosa.Cli.Tests: CliRun bounds each CLI run at 60 seconds. The CLI sets no
  default deadline on an MP call, so a fake that never answered held the whole
  assembly forever; such a run now fails its test with a TimeoutException that says
  why. Checked with a fake that never answers: the run failed at 60.1 s and the
  server still stopped.

The 15-minute job limit stays: the slowest green 2026 job today took 10:00, and a
hang caught at three minutes ends the job by about 12.5 minutes.

Refs #467

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rved

Two failures of the 2026 job came from the test process itself being starved for
seconds on a loaded runner, not from what the tests check.

- RequestValidationDetailGrpcTests (both targets) failed at Failures == 0: the
  provider's bounded log drain did not finish in its default 2 seconds. The test
  took 2.64 s against 0.30 s when it passed, so it waited out the whole bound. The
  drain runs on a thread-pool thread; with the pool saturated, a local experiment
  saw Dispose wait 8.1 s before the drain ran. The test now gives the drain the
  longest bound the option allows (10 s). A drain that still misses it is counted
  in Failures, so the test still fails on a dropped record, a failed sink, a value
  in any output, or a partial log. GeneratedClientPerformanceEvidenceTests had the
  same pattern and gets the same bound.
- TypedFileUiAndControlOperationTests failed with "An existing connection was
  forcibly closed by the remote host" on its first call, after about 6 seconds,
  from its own loopback Kestrel host. Kestrel's default minimum request-body data
  rate (240 B/s after a 5-second grace) aborts the whole HTTP/2 connection when a
  request body arrives late, and the host's client runs in the same starved
  process. A request body sent 8 s late to a default host gave exactly that error
  chain after 6.1 s; one sent 3 s late succeeded. GrpcTestHost now has
  WithoutMinimumDataRates, applied to all seven in-process test hosts of
  Briosa.Server.Tests in both targets. Production hosting keeps Kestrel's defaults,
  and no call is retried.

Refs #467

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Product fault: a Briosa.Cli call could wait forever. The ASP.NET Core 10.0.15
runtime the server ships has an HTTP/2 defect (dotnet/aspnetcore#70124, fixed by
dotnet/aspnetcore#70100, in no released runtime yet): when the tail of a response
waits on the client's stream window and a window update races its final write,
the next response on a reused stream of that connection is never sent. A call
sends GetServerInfo, ListCapabilities with denied operations (about 190 KB, more
than the 65,535-byte default window) and then the MP call on one connection, and
an MP call has no default deadline.

This is the Briosa.Cli.Tests hang of #467. The delivery fault matrix makes 664 such
calls against the Kestrel fake. Locally it stalled 3 times in 97 runs of the
assembly under load, each time in that test. A run with HTTP/2 tracing caught one:
the fake received the MP call and completed it, the client sent all of it and
waited, and no frame of the response arrived, while the listing before it had a
stream window update in flight.

The CLI now advertises an initial stream window of the 4 MiB receive limit plus
64 KiB, so no response it accepts ever waits on that window and the condition
cannot arise. StreamWindowTests reads the window from the CLI's first SETTINGS
frame. The operations guide says why.

Refs #467

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- FakeBriosaServer signalled MpCallReceived before it read the reply it would send,
  so a test that changed Reply when the call arrived could change the reply of the
  call already in flight. It now fixes the reply first. No test on main changes the
  reply after the arrival, and in both traced stalls of #467 the reply had already
  been produced, so this is not the cause of that hang.
- SpillDirectoryTests.CreateJunction waited for `cmd /c mklink` with no bound and
  left both redirected streams unread. A child that did not exit, or filled a pipe,
  would have held the whole assembly. It now drains both streams, waits at most 30
  seconds, and ends the child and fails the test with a message when it does not
  exit. Every local hang was named as the fault matrix, not a junction test.

Refs #467

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…sequence file

Review of #470: three test invocations that CI reaches still ran without hang
diagnostics, so a hang there would still run to the job limit unnamed. Both
targets' Test-LocalSpatialAnalyzerHost.ps1 (before the solution tests),
Test-RuntimePerformance.ps1 and Test-ObservabilityPerformance.ps1 now pass
--blame-hang-timeout 3m and --blame-hang-dump-type none, and accept a results
directory.

Every dotnet test reached by ci.yml or release.yml is now covered: in ci.yml the
source-host script, the solution tests, the Debug reflection and manual-startup
tests and the two performance scripts; in release.yml the solution tests and the
Debug tests. No other workflow and no other eng script runs dotnet test or VSTest.

- ci.yml: each test invocation writes its own subdirectory of
  artifacts/test-results, and the upload moves after the last test step, so the
  Debug run's and the scripts' sequence files are kept too.
- Verify-CiWorkflow.ps1 rejects a step of any workflow, or an eng script, that
  runs dotnet test without both settings. The new Test-CiWorkflowPolicyChecks.ps1,
  run in CI and required by the checker, proves the rejection on mutated copies.
  Against the previous head the checker names exactly the six scripts above.
- The comments and eng/security-baseline.md describe the three minutes as VSTest's
  host inactivity timer: test starts and finishes reset it, and more than one test
  can be unfinished when it fires, so the names are candidates. The baseline also
  says what a sequence file holds. Every theory in both targets takes fixed test
  data, so display names carry no path, environment value, user or generated value.

Refs #467

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…their resources

Review of #470:

- CliRun: a run that missed its 60-second bound failed the test and disposed the
  run's output streams while the CLI kept going, so a late reply wrote to a
  disposed stream and a reserved --output file could outlive the test's directory.
  The CLI now sees the caller's token through a test-owned linked one. After a
  timeout that token is cancelled, the run gets 30 seconds to end, and the timeout
  is still the test's failure. The streams and the token source are disposed only
  when the run has ended, and its outcome is observed. Until a timeout nothing
  about the run changes.
- CreateJunction: Process.Kill only starts the termination. After a timeout the
  helper now waits up to 10 seconds for the child to exit and for both pipe reads
  to end, and after a normal exit it observes both reads, within 10 seconds.

Refs #467

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review of #470: the privacy test now accepts a drain of up to 10 seconds and the
blocked-sink test sets 50 ms, so nothing pinned the 2,000 ms default the server
ships. ObservabilityTests (both targets) asserts it from the option's default,
an empty configuration, the packaged appsettings.json, and a provider built from
the defaults.

Refs #467

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review of #470: the shared test host's comment (both targets) and the stream
window test's comment stated the hosted failures' causes as fact. The hosted runs
recorded neither the body timing nor Kestrel's abort reason, and the CLI hang has
no trace. They now say what the local experiments showed and that the hosted
cause is inferred. The guide and BridgeContract now limit "never waits" to a unary
response the CLI accepts, and say the MP call would wait until interrupted or the
connection ends rather than forever.

Refs #467

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s checked

Refs #467

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
davidalucas and others added 2 commits November 28, 2026 11:57
Re-check of #470: Verify-CiWorkflow.ps1 searched a whole workflow step or script
for both settings, so a step whose run block held two dotnet test commands passed
when only one of them carried the settings.

The checker now splits a step's run value, with a literal block kept line by line
and a folded block folded, and each eng script into dotnet test invocations: a
command line, with backtick and backslash continuations joined, from "dotnet test"
to the next unquoted ; && || or |, or a PowerShell argument array written as
@("test", ...). Each invocation must carry both settings itself, and a finding
names the invocation. A comment states what the check does not see: invocations
built from variables or splatting elsewhere, settings appended to an array after
it is written (reported as missing), other runners, and composite actions.
The checker and its mutation test are skipped, since they hold "dotnet test" only
as fixture text.

Test-CiWorkflowPolicyChecks.ps1 adds rejections for two commands in one step with
the settings on the first only, settings on another command in the same line,
and a second argument array in a covered script. It also proves that a command
continued over lines with its settings is accepted.

Refs #467

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…unction waits

Re-check of #470:

- CliRun awaited the cancellation before it started its 30-second cleanup, so a
  cancellation callback blocked on a lock could hold the test until the outer hang
  detector. One deadline, started before the cancellation, now covers both the
  callbacks and the run's end, and both tasks are observed. The run starts on the
  thread pool, so the 60-second bound also covers synchronous work before the CLI's
  first await. A run that has not ended by the deadline, for example one stalled in
  a synchronous file flush, is reported as abandoned still running and possibly
  holding files it created, such as an --output or spill file; later timeouts in the
  assembly say how many such runs are still running. In process the run cannot be
  stopped; only a process boundary would guarantee it releases its files, and this
  harness does not build one.
- CreateJunction now uses one 10-second deadline after it ends a child that did
  not exit, for the exit and both pipes, so it waits at most 40 seconds in all,
  and its failure says which of the two did not happen.

Refs #467

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@davidalucas
davidalucas merged commit d93c894 into main Nov 28, 2026
35 checks passed
@davidalucas
davidalucas deleted the 467-cli-test-hang branch November 28, 2026 17:15
davidalucas added a commit that referenced this pull request Nov 28, 2026
Brings #470: the client
stream window above the receive limit, bounded CLI test runs, and hang
detection on every test invocation. The one conflict, the MP branch of
FakeBriosaServer.HandleAsync, keeps main's order (the reply is fixed
before the arrival is signalled) together with this branch's arrival
semaphore and concurrency count.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant