diff --git a/.github/workflows/cultmesh-portability.yml b/.github/workflows/cultmesh-portability.yml index bafe70fc..116e4eb6 100644 --- a/.github/workflows/cultmesh-portability.yml +++ b/.github/workflows/cultmesh-portability.yml @@ -25,9 +25,9 @@ jobs: reactive-and-resource-lifetime: name: ${{ matrix.os }} reactive semantics and leases runs-on: ${{ matrix.os }} - # The job dies at the lower of this value and the forge runner's own cap, which Eureka is raising from 30 to 60 minutes - # (run 1378 carried 60 and was still cancelled at 30:02); the two must both say 60 before a full run can finish. - timeout-minutes: 60 + # Normal runs hold the slot 14 to 30 minutes, so 45 bounds a hang with margin. A dotnet test step that stops answering is also + # ended by its own --blame-hang-timeout, which names the test that hung, instead of waiting for this cap. + timeout-minutes: 45 strategy: fail-fast: false matrix: @@ -128,7 +128,7 @@ jobs: run: >- dotnet test tests/GameCult.Mesh.Tests/GameCult.Mesh.Tests.csproj --filter FullyQualifiedName~Document_OneHundredThousandDistinctLeaseCyclesLeaveNoResourcesOrCallbacks - --logger "console;verbosity=minimal" + --blame-hang-timeout 10m --logger "console;verbosity=minimal" # The TypeScript side of the CultMesh authority rules. This job is the # only one that runs on Linux for main, codex/** and pull requests (and on @@ -166,7 +166,7 @@ jobs: # culture and throws CultureNotFoundException; it is excluded here and still runs wherever ICU is present # (variants:follow_up:culture-test-invariant-image). - name: Verify the CultCache document owner with the C# reference - run: dotnet test tests/GameCult.Caching.Tests/GameCult.Caching.Tests.csproj --filter "FullyQualifiedName!~ADeterministicIdIsTheSameUnderEveryCulture" --logger "console;verbosity=minimal" + run: dotnet test tests/GameCult.Caching.Tests/GameCult.Caching.Tests.csproj --filter "FullyQualifiedName!~ADeterministicIdIsTheSameUnderEveryCulture" --blame-hang-timeout 10m --logger "console;verbosity=minimal" # Packs the four TypeScript packages and installs them into a clean consumer, so a package that builds but does # not install or load fails here. @@ -201,7 +201,7 @@ jobs: run: >- dotnet test tests/GameCult.Mesh.Tests/GameCult.Mesh.Tests.csproj --filter FullyQualifiedName~AuthorityProof - --logger "console;verbosity=minimal" + --blame-hang-timeout 10m --logger "console;verbosity=minimal" # The other half of the frame parity: the C# reference decodes and # re-encodes the vector file the TypeScript codec wrote. A fixture @@ -210,7 +210,7 @@ jobs: run: >- dotnet test tests/GameCult.Mesh.Tests/GameCult.Mesh.Tests.csproj --filter FullyQualifiedName~RealtimeWireProtocol - --logger "console;verbosity=minimal" + --blame-hang-timeout 10m --logger "console;verbosity=minimal" # The content plane: the reference writes the manifest and record-key # vectors and judges the manifests the TypeScript packer wrote @@ -221,7 +221,7 @@ jobs: run: >- dotnet test tests/GameCult.Mesh.Tests/GameCult.Mesh.Tests.csproj --filter FullyQualifiedName~CultMeshContentVectorTests - --logger "console;verbosity=minimal" + --blame-hang-timeout 10m --logger "console;verbosity=minimal" # The cross-process HTTPS content parity: the C# transfer service over the unmodified HTTPS connector and the # TypeScript reader fetch from the TypeScript provider in its own process. Both refuse bytes tampered in flight, diff --git a/tests/GameCult.Caching.Tests/UpdateTests.cs b/tests/GameCult.Caching.Tests/UpdateTests.cs index 63462ba6..d8ec67e5 100644 --- a/tests/GameCult.Caching.Tests/UpdateTests.cs +++ b/tests/GameCult.Caching.Tests/UpdateTests.cs @@ -80,16 +80,27 @@ namespace GameCult.Caching.Tests var applied = 0; // Each round starts both writers together: an attempt reads fresh from the store, so only overlapping read-commit windows lose. var round = new Barrier(2); + // Starting together does not make the read-commit windows overlap: on a loaded or few-core machine one writer can finish its + // whole attempt before the other wakes, and then no attempt is ever lost. So each writer's first apply waits for the other's: + // both have read the seed by then, only one commit can win it, and the loser must rerun. That makes the race certain once. + var firstApplies = new Barrier(2); var racers = new[] { a, b }.Select(cache => Task.Run(() => { var results = new List(); + var firstApply = true; for (var i = 0; i < n; i++) { round.SignalAndWait(); results.Add(cache.Update(Key, counter => { Interlocked.Increment(ref applied); + if (firstApply) + { + firstApply = false; + Assert.That(firstApplies.SignalAndWait(TimeSpan.FromSeconds(30)), Is.True, "the other writer never began its first update"); + } + return Plus(counter, 1); }, maxAttempts: 200).Outcome); }