Repository navigation
CI: RavenDbTests host exits right after its run (#6162); split CIMartenNaturalKeys out of CIMartenDistribution (#6163) - #6168
Merged
Conversation
… of idling ~2 minutes
Two things held the RavenDbTests host open after its last test, and Bobcat's supervisor killed it
113-201s later on CI ("the worker did not exit when asked"):
- The "raven" collection fixture (DatabaseFixture, a RavenTestDriver) hands a fresh database to nearly
every test and none were disposed until xUnit tore the fixture down after the last test.
RavenTestDriver.Dispose() disposes every store it handed out, and each store's disposal deletes its
database, one request at a time: 60s locally before the run could even report. The databases live in the
in-memory embedded test server, which goes away with the process, so DatabaseFixture.Dispose() no longer
deletes them. Tests that dispose their own store still delete their database as before.
- The embedded server is stopped from a ProcessExit handler that waits up to GracefulShutdownTimeout for a
graceful shutdown: 5s with one database, ~30s with a run's worth, against the 5s the supervisor gives a
worker to exit. The throwaway server now gets GracefulShutdownTimeout = 0.
Locally the host now exits ~0.3s after the run summary (was 69s for the full suite), and
`./build.sh CIRavenDb` runs RavenDbTests and RavenDbTests.LeaderElection with no worker killed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CIMartenDistribution ran 17:31 and 17:29 of the 20 minute cap on main (runs 47126586149 and 47173742063), ~15m of it tests. The natural key matrices of AggregateHandlerWorkflow are most of the growth since the namespace split. CIMartenNaturalKeys takes ten natural key classes plus multi_stream_batched_fetches and tenant_partitioned_aggregate_matrix for balance (~445s of tests measured from run 47173742063's log); CIMartenDistribution keeps its namespaces minus that list (~448s), so a new class still runs there. Added to the TESTS_MATRIX list and MartenTests' CI targets in LocalGate; gates.json regenerated. CIRavenDb is not split: with GH-6162's fix it loses its ~2-3 minutes of idle tail and should run ~12-15 minutes. CIEfCore (11:51-13:33) and CIMarten (9:58-15:03) are left as they are. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #6162
Closes #6163
#6162: the RavenDbTests host idles before it is killed
On main, Bobcat's supervisor killed the RavenDbTests host 113s, 114s and 201s after its last test started (runs 47173742063, 47174541236 and 47126586149: "the worker did not exit when asked"). RavenDbTests.LeaderElection was killed the same way, about 12s after its last test started. Two causes, both in
DatabaseFixture(src/Persistence/RavenDbTests/message_store_compliance.cs):DatabaseFixtureis the"raven"collection fixture, aRavenTestDriver, andStartRavenStore()gives nearly every test a fresh database. None of those stores is disposed until xUnit tears the fixture down after the last test.RavenTestDriver.Dispose()then disposes every store it handed out, and disposing each store deletes its database, one request at a time. Locally the run summary came out 60s after the last test. The databases live in the embedded test server, which runs in memory and goes away with the process, soDatabaseFixture.Dispose()no longer deletes them. A test that disposes its own store still deletes its database as before.GracefulShutdownTimeoutbefore it kills the server. A native sample of the host during the exit window shows the finalizer thread inAppDomain::RaiseExitProcessEvent, blocked on a wait handle. That took 5s with one database and ~30s with a run's worth of them (with fix 1 alone the host printed "Foreground threads were left running, forcing process exit"). The supervisor allows 5s. The server is throwaway, so it now getsGracefulShutdownTimeout = TimeSpan.Zero.Measured locally (test host run directly, time from the last test result to process exit):
./build.sh CIRavenDb --framework net10.0under the supervisor: 465 + 50 passed, no worker killed, 8:28 for the target locally.#6163: shard CIMartenDistribution
Per-job times on green main runs, 2026-12-03:
CIMartenDistribution is split by class, using the RabbitMQ pattern (#6141). The new CIMartenNaturalKeys takes these classes. Per-class times are summed from the
[lane 0] ->start lines in the log of run 47173742063:CIMartenDistribution is defined as its namespaces minus the CIMartenNaturalKeys list, so a new class in those namespaces still runs there. With ~2.5 minutes of build and docker per job, expect about 10 minutes for each of the two jobs, down from 17.5.
CIRavenDb is not split. The fix for #6162 removes 2-3.5 minutes of idle tail (114s, 113s and 201s) plus the LeaderElection kill. On those three runs the job would have taken about 13:10, 12:50 and 15:00, against 15:05, 14:46 and 18:28. That is about 15 minutes or less, so the job is left whole. If it creeps up again, RavenDbTests and RavenDbTests.LeaderElection are a natural two-way split.
CIEfCore and CIMarten peak at 13:33 and 15:03, so they are not changed here.
The new target is in
TESTS_MATRIX(tests.yml), in MartenTests' CI targets inbuild/LocalGate.cs(which is howTestsMatrixPlanandAffectedGatemap it), inbuild/gates.json(regenerated) and in.claude/docs/test_gates.md.Verified
dotnet build build/build.csprojdotnet build wolverine.slnx -c Release -f net10.0: 0 warnings, 0 errors./build.sh LocalGateManifest(gates.json regenerated),./build.sh VerifyCITargetCoveragepasses./build.sh PlanTestsMatrixwith the workflow's list: 44 targets, including CIMartenNaturalKeys./build.sh CIRavenDb --framework net10.0(465 + 50 passed, no kill)This PR changes
build/and.github/, so its CI runs the full matrix, which checks the new timings.🤖 Generated with Claude Code