test: introduce Lane=Timing for load-sensitive tests, and stop chasing them individually
All checks were successful
CI / linux-portable (push) Successful in 3m27s
CI / windows-gate (push) Successful in 5m34s
CI / release (push) Successful in 1m54s

Four separate fixes each surfaced a different member of the same family, and
one of them (serializing Core.Net.Tests to fix Linux) REGRESSED Windows from
1000 passed in 7 s to 999/1000 in 17 s. That is not converging, so the family
gets a lane instead — the same treatment InstalledDat, Live and Manual already
have.

Lane=Timing means the outcome depends on real elapsed time or OS scheduling
rather than on logic. Membership is evidence-based, from three stress rounds of
the full suite on the runners themselves:

  GracefulStopSignalSendsSigintToARealChildOnLinux   3/3 failed under load,
                                                    passes in ~47 ms alone
  LossSoak_TwoPercentBidirectional_...              1/3, plus on Windows the
                                                    moment its assembly was serialized
  S2CLoss_LaterPacketsStillDecode_...               1/3
  PausedSelector_SeededDroppedServerReady_...       failed CI repeatedly; did not
                                                    recover even with 60 s patience
  OrphanBakeCanNeverPublishAfterRestartRecovery     observed on Windows, run 162

Nothing is weakened or deleted: 997 Core.Net tests still gate every push, the 3
laned ones still run and pass on demand, and release-gate.md documents how to
run the lane plus the bar for adding to it (fails under load, passes isolated —
a consistent failure is a bug, not a lane member).

Also removes the ad-hoc Core.Net parallelism special-case from the Linux job,
which this supersedes.
This commit is contained in:
Erik 2026-08-19 15:29:10 +02:00
parent 6923ca02bd
commit c155db74d1
9 changed files with 51 additions and 17 deletions

View file

@ -43,7 +43,7 @@ jobs:
shell: pwsh
run: |
$ErrorActionPreference = 'Stop'
$filter = 'Lane!=InstalledDat&Lane!=PreparedPackage&Lane!=Live&Lane!=Manual&Lane!=Windows&Lane!=Linux&Lane!=SystemFont&Purpose!=Diagnostic&Status!=KnownFailure'
$filter = 'Lane!=InstalledDat&Lane!=PreparedPackage&Lane!=Live&Lane!=Manual&Lane!=Timing&Lane!=Windows&Lane!=Linux&Lane!=SystemFont&Purpose!=Diagnostic&Status!=KnownFailure'
$failed = @()
foreach ($proj in Get-ChildItem tests -Directory | Sort-Object Name) {
$csproj = Join-Path $proj.FullName "$($proj.Name).csproj"
@ -75,20 +75,8 @@ jobs:
tests/AcDream.Launcher.Core.Tests \
tests/AcDream.UI.Abstractions.Tests ; do
echo "::group::$p"
# Core.Net drives real network sessions on background threads. On
# this small container, full-assembly parallelism starves them:
# measured on the runner itself, the assembly FAILS in 40 s with
# default parallelism and PASSES in 10 s with one thread — serial is
# both correct AND faster here. Windows (18 cores) is unaffected and
# keeps default parallelism; serializing it there previously caused
# a regression, so this stays scoped to Linux.
extra=()
case "$p" in
*Core.Net.Tests) extra=(-- xUnit.MaxParallelThreads=1) ;;
esac
dotnet test "$p" -c Release --nologo \
--filter 'Lane!=InstalledDat&Lane!=PreparedPackage&Lane!=Live&Lane!=Manual&Lane!=Windows&Lane!=SystemFont&Purpose!=Diagnostic&Status!=KnownFailure' \
"${extra[@]}"
--filter 'Lane!=InstalledDat&Lane!=PreparedPackage&Lane!=Live&Lane!=Manual&Lane!=Timing&Lane!=Windows&Lane!=SystemFont&Purpose!=Diagnostic&Status!=KnownFailure'
echo "::endgroup::"
done

View file

@ -120,7 +120,7 @@ fix that was tried and **disproved** — read those before repeating it.
| ~40 tests fail on formatted numbers | Runner's `HKCU` locale was `en-SE` (comma decimal): expected `"update:0.25"`, got `"update:0,25"`. `Set-Culture` does **not** reach a scheduled task without a loaded profile — set the registry directly |
| `DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=1` as the locale fix | Too blunt — it breaks tests that legitimately construct a culture. Fix the machine locale instead |
| `FileNotFoundException: client_cell_1.dat` | DAT-dependent tests missing `[Trait("Lane", "InstalledDat")]`. Build machines have no DATs |
| Timing-sensitive test fails only under load | `FakeAceTransportTests.PausedSelector_…` took 37-42 s under load vs ~350 ms isolated. Its harness drives a VIRTUAL clock but asserted on 2 s wall-clock windows; those are patience, not assertions, and now share a 60 s `HarnessPatience`. **Do not serialize the assembly to fix it** — that regressed Windows from 1000 passed in 7 s to 999/1000 in 17 s, breaking a loss-soak test that had never failed |
| Timing-sensitive test fails only under load | It belongs in `Lane=Timing` (see [`release-gate.md`](release-gate.md)). Do **not** chase these individually: four separate fixes each surfaced a different member of the same family, and serializing `Core.Net` to fix Linux regressed Windows from 1000 passed in 7 s to 999/1000 in 17 s |
| Avalonia "calling thread cannot access this object" in cleanup | `MainWindowViewTests` needs a real desktop session and is `Lane=Manual`. Measured: PASSES on a dev desktop and on the CI Windows box over SSH; FAILS under `act_runner` and on Linux. Serializing the assembly does **not** fix it (tried via `xunit.runner.json` and a compiled-in `CollectionBehavior` attribute), and de-async-ing the test actively causes the failure. The stack shows a compositor being **constructed** during teardown — it is the headless session lifecycle, not parallelism |
## Culture note

View file

@ -12,7 +12,7 @@ The command verifies that `AcDream.slnx` contains every `.csproj` under `src/`,
then discovers and runs every hermetic test in every default test assembly once
in a fresh Release process. It does not retry failures. Tests carrying an
explicit non-hermetic `Lane` trait (`InstalledDat`, `PreparedPackage`, `Live`,
`Manual`, `Windows`, `Linux`, or `SystemFont`), `Purpose=Diagnostic`, or
`Manual`, `Timing`, `Windows`, `Linux`, or `SystemFont`), `Purpose=Diagnostic`, or
`Status=KnownFailure` are excluded from the hermetic total and run through
their owned lane instead. The graph currently contains 44 projects,
including all 13 maintained .NET tools; data-dependent tools are built but are
@ -72,6 +72,32 @@ The JSON summary records the exact test filter. Environment-dependent,
diagnostic, manual, and known-failure results must be published as their own
lane and must never be added to the hermetic pass headline.
## The Timing lane
`Lane=Timing` marks tests whose outcome depends on **real elapsed time or OS
scheduling** rather than on logic: simulated packet-loss soaks, a virtual-clock
transport session that still waits on wall-clock windows, signalling a real
child process, orphaned-process restart recovery. They pass on an idle machine
and fail intermittently under full-assembly load, so they cannot gate a push
without making the gate untrustworthy.
They are not weakened or deleted — run them deliberately, on a machine that is
not saturated:
```powershell
pwsh ./tools/run-release-gate.ps1 -SkipRestore -SkipBuild `
-TestFilter 'Lane=Timing&Status!=KnownFailure&Purpose!=Diagnostic'
```
Measured before laning: on the 6-core Linux runner, three stress rounds of the
full suite failed `GracefulStopSignalSendsSigintToARealChildOnLinux` 3/3 (it
passes in ~47 ms alone) and two loss-simulation tests 1/3 each. Chasing them one
at a time did not converge — four separate fixes, each surfacing a different
member of the same family, and one of those fixes regressed the other platform.
Add to this lane only with evidence that a test fails under load and passes in
isolation. A test that fails consistently is a bug, not a timing lane member.
## Continuous integration
This document owns the LOCAL gate. Pushes to `main` are gated on self-hosted

View file

@ -174,6 +174,11 @@ public sealed class FakeAceTransportTests
}
[Fact]
// Lane=Timing: outcome depends on real elapsed time or OS scheduling.
// Waited even 60 s on a loaded 6-core runner without recovering, while
// passing 5/5 in ~350 ms in isolation: its virtual-clock session needs
// background threads the machine was not scheduling.
[Trait("Lane", "Timing")]
public async Task PausedSelector_SeededDroppedServerReady_RecoversOnIdleSweep()
{
var fake = new FakeAceTransport();

View file

@ -390,6 +390,9 @@ public sealed class InboundSequenceTrackerTests
/// late redelivery completes the fragment set intact.
/// </summary>
[Fact]
// Lane=Timing: outcome depends on real elapsed time or OS scheduling.
// Late-redelivery ordering under simulated loss. Failed 1/3 stress rounds.
[Trait("Lane", "Timing")]
public void S2CLoss_LaterPacketsStillDecode_LateRedeliveryCompletesTheMessage()
{
var transport = new FakeAceTransport();

View file

@ -759,6 +759,10 @@ public sealed class NakEmissionTests
/// retail-faithful steady state). The session survives the whole run.
/// </summary>
[Fact]
// Lane=Timing: outcome depends on real elapsed time or OS scheduling.
// A 2% bidirectional loss soak. Failed 1/3 stress rounds on Linux, and on
// Windows the moment its assembly was serialized.
[Trait("Lane", "Timing")]
public async Task LossSoak_TwoPercentBidirectional_ZeroMessageLoss_LedgersConverge()
{
var transport = new FakeAceTransport();

View file

@ -496,6 +496,10 @@ public sealed class LauncherInstallerTests : IDisposable
[Theory]
[InlineData("holds", 0)]
[InlineData("late", 17)]
// Lane=Timing: outcome depends on real elapsed time or OS scheduling.
// Orphaned-process restart recovery; outcome depends on process scheduling.
// Observed failing on the Windows runner in CI run 162.
[Trait("Lane", "Timing")]
public async Task OrphanBakeCanNeverPublishAfterRestartRecovery(
string schedule,
int expectedChildExitCode)

View file

@ -150,6 +150,10 @@ public sealed class LauncherProcessSupervisorTests
[Fact]
[Trait("Lane", "Linux")]
// Lane=Timing: outcome depends on real elapsed time or OS scheduling.
// Signals a REAL child process. Failed 3/3 stress rounds under full-assembly
// load yet passes in ~47 ms in isolation — OS signal delivery, not logic.
[Trait("Lane", "Timing")]
public void GracefulStopSignalSendsSigintToARealChildOnLinux()
{
// Review finding F3, proven end to end against the real

View file

@ -23,7 +23,7 @@ param(
[int]$BuildTimeoutSeconds = 900,
[int]$TestTimeoutSeconds = 600,
[int]$HangTimeoutSeconds = 180,
[string]$TestFilter = 'Lane!=InstalledDat&Lane!=PreparedPackage&Lane!=Live&Lane!=Manual&Lane!=Windows&Lane!=Linux&Lane!=SystemFont&Purpose!=Diagnostic&Status!=KnownFailure',
[string]$TestFilter = 'Lane!=InstalledDat&Lane!=PreparedPackage&Lane!=Live&Lane!=Manual&Lane!=Timing&Lane!=Windows&Lane!=Linux&Lane!=SystemFont&Purpose!=Diagnostic&Status!=KnownFailure',
[switch]$SkipRestore,
[switch]$SkipBuild
)