Repository navigation
fix(test): both CI flakes at the root — a paged-out assertion and a halved compile budget (#834) - #836
Conversation
… compile budget Neither was chance, and both landed on PRs that changed nothing (#834). CrossPartitionRealUserQueryTests: RunUnpinned issued a GLOBAL nodeType:Markdown query capped at Limit=10, and the System case then asserted its own seeded row was in the result — which only holds while fewer than 10 other Markdown nodes exist anywhere. On a shared database with sibling tests writing concurrently the row is simply paged out. The System case now scopes the query to the partition it seeded, so no unrelated writer can displace it; the two cases that assert only the shape of the first emission stay global. DynamicGraphIntegrationTest: the compile test performs a real on-demand Roslyn compile behind stream assertions left on the 10s default, inside a Fact that declared 20s — the inner wait silently capped at half the intended budget and a loaded runner exceeded it. The waits are now explicit (30s) inside a 60s Fact, matching the sibling tests. No product code changed; no gate weakened. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CsVb5f4N6KuJnvLaNrvjDB
There was a problem hiding this comment.
Pull request overview
This PR addresses two independent CI flakes by (1) making a cross-partition query test deterministic under paging/limit pressure from other concurrent writers, and (2) aligning reactive assertion timeouts with the actual cost of an on-demand Roslyn compile in an integration test.
Changes:
- Add an optional
namespaceScopeto theRunUnpinnedhelper and use it for the System-case assertion to avoid “paged out” results underLimit = 10. - Increase
FileSystem_Organizations_GetsHubConfiguration_FromCompiledAssemblytest timeout and make stream assertion waits explicit (30s) to match the intended budget.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| test/MeshWeaver.Hosting.PostgreSql.Test/CrossPartitionRealUserQueryTests.cs | Adds optional namespace scoping to avoid nondeterministic assertions against a global capped query. |
| test/MeshWeaver.Hosting.Monolith.Test/DynamicGraphIntegrationTest.cs | Makes observable assertion timeouts explicit for an on-demand compile path and adjusts the fact timeout accordingly. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| var change = await RunUnpinned(WellKnownUsers.System, namespaceScope: nsA) | ||
| .FirstAsync() | ||
| .Timeout(TimeSpan.FromSeconds(20)) | ||
| .ToTask(); | ||
|
|
||
| change.ChangeType.Should().BeOneOf(QueryChangeType.Initial, QueryChangeType.Reset); | ||
| change.Items.Should().Contain(n => n.Path == $"{nsA}/doc1", | ||
| "System sees every partition's rows"); | ||
| "System reads a partition it was never granted — the query is scoped to that partition, " | ||
| + "so this cannot be crowded out by rows other tests happen to be writing"); |
|
Reviewed against the source. Fix 1 is a genuine root cause. Fix 2's justification doesn't match its diff. Detail below, plus a coverage note. 1.
|
Test Results (shard 0)718 tests 714 ✅ 4m 50s ⏱️ Results for commit 459b440. |
Test Results (shard 4)1 020 tests 1 013 ✅ 5m 18s ⏱️ Results for commit 459b440. |
Test Results (shard 2)1 636 tests 1 635 ✅ 4m 56s ⏱️ Results for commit 459b440. |
Test Results (shard 3) 11 files 11 suites 5m 49s ⏱️ Results for commit 459b440. |
Test Results (shard 5)1 537 tests 1 433 ✅ 5m 52s ⏱️ Results for commit 459b440. |
Test Results (shard 1)1 616 tests 1 429 ✅ 7m 35s ⏱️ Results for commit 459b440. |
Test Results 63 files 63 suites 34m 23s ⏱️ Results for commit 459b440. |
Fixes both flakes from #834. Neither was chance, and both landed on PRs that changed nothing — #829 (skills/chart/docs) and #832 (one markdown file).
1.
CrossPartitionRealUserQueryTests— the row was paged outRunUnpinnedissued a globalnodeType:Markdownquery capped atLimit = 10, andUnpinnedStructuredQuery_AsSystem_EmitsInitialthen asserted its own seeded{nsA}/doc1was in the result. That only holds while fewer than ten other Markdown nodes exist anywhere — so against a shared PostgreSQL with sibling tests writing concurrently, the seeded row falls off the page. Hence intermittent, load-dependent, and unrelated to the diff.The System case now scopes the query to the partition it seeded, so no unrelated writer can displace its row. The two sibling cases assert only the shape of the first emission, so they stay global deliberately. The helper carries a comment explaining which kind of test may skip the scope, since all three share it.
Also corrected the assertion's
because: as written it claimed "System sees every partition's rows" while actually proving "…within the first 10 global results".Not a first-frame-completeness race — the
GetQuerycontract (gate the first emission until every sub-query has produced itsInitial) is not implicated.2.
DynamicGraphIntegrationTest— the budget was halvedThe compile test performs a real on-demand Roslyn compile, but its stream assertions were left on
ObservableAssertions.DefaultTimeout(10s) inside a[Fact(Timeout = 20000)]. The inner wait silently capped at half the budget the author had declared, and a loaded runner exceeded it.The waits are now explicit (30s) inside a 60s Fact, matching the sibling tests in the file. This is aligning a wait with the operation it wraps, not widening a timeout to hide a defect — the existing
Should(TimeSpan)overload exists for exactly this.Tested
Both test projects build clean under CI flags (
-c Release -p:CIRun=true -warnaserror). No product code changed; no gate weakened.🤖 Generated with Claude Code
https://claude.ai/code/session_01CsVb5f4N6KuJnvLaNrvjDB