Skip to content

Flakes: give hub tests a budget the CI fixture can actually meet - #688

Merged
rbuergi merged 1 commit into
mainfrom
fix/main-flakes
Jul 29, 2026
Merged

rbuergi merged 1 commit into
mainfrom
fix/main-flakes

Conversation

@rbuergi

@rbuergi rbuergi commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

The catalogue first

Pulled every red main run of the last two days from check annotations. Four named flakes, and not one is a bad assertion — all four are timeouts:

test red main runs failure
MeshNodeVersionSyncTest.MeshNode_InitialVersion_IsZero 1 Test execution timed out after 10000 milliseconds
TwoSiloRecycleConvergenceTest.PostRecycleUpdate_NonOwnerSiloMirror_Converges 2 System.TimeoutException
TwoWaySyncTest.TwoWay_Update_KeepsServerAddition_UnlessForced 1 System.TimeoutException
ThreadAgentIntegrationTest.FullFlow_CreateThread_SendMessage_NonStreaming 1 GetMeshNode(…) timed out after 60.0s

What this PR fixes: budgets a correct test could never meet

The same CI log for MeshNodeVersionSyncTest shows:

19:59:22.595  === TEST CLASS INIT ===
19:59:30.720  [DISPOSE] Mesh.Dispose() invoking

8.1 s of mesh fixture inside a 10 s budget — 1.9 s left for the body. On a quiet runner it fits; under an 8-shard load it cannot. The test was measuring the runner.

[HubFact] carried the same trap globally: 5 s in Release (i.e. CI), which the fixture alone can exceed. It bit a heartbeat test written the same night — green locally, where no budget is enforced, and impossible on CI.

Both move to 30 s, matching the runner-wide methodTimeout.

Nothing is masked. A genuine wedge surfaces its own GetMeshNode … timed out after 60.0s first, so a hang still fails the test — just not before the fixture has finished starting.

Not fixed here — and NOT budget noise

The other three are recorded in the commit so nobody dismisses them as timing:

ThreadAgentIntegrationTest fails with

GetMeshNode('ACME/ProductLaunch') timed out after 60.0s — the owning per-node hub never
answered the GetDataRequest. NO LOCAL HUB … it never activated here.

That is the same cold-hub-activation defect measured in production this week (#686: 0 ms source discovery on a fresh mesh, 45.20 s on memex). These flakes are that bug reproducing under CI load — real signal, and they should stay red until it is fixed rather than be timed away.

Testing

409/409 Persistence, 290/290 Data.

🤖 Generated with Claude Code

Copilot AI review requested due to automatic review settings July 28, 2026 05:04

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adjusts test timeouts to better reflect the real cost of bringing up the mesh fixture under CI load, reducing “runner budget” flakes where the fixture startup consumes most of the per-test timeout.

Changes:

  • Increased explicit timeouts in MeshNodeVersionSyncTest from 10s to 30s.
  • Updated HubFactAttribute (non-DEBUG) timeout from 5s to 30s and expanded its XML documentation to explain the rationale.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
test/MeshWeaver.Persistence.Test/MeshNodeVersionSyncTest.cs Bumps per-test [Fact(Timeout=…)] budgets to 30s to avoid CI fixture-startup timeouts.
src/MeshWeaver.Fixture/HubFactAttribute.cs Raises the default Release/CI hub-test timeout to 30s and documents why the prior 5s budget was not achievable on CI.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +24 to +26
/// <para>30s matches the runner-wide <c>methodTimeout</c> and still fails a genuine wedge well
/// before the run hangs — a wedged read surfaces its own <c>GetMeshNode … timed out after 60.0s</c>
/// first, so nothing is masked by the larger budget.</para>
@github-actions

github-actions Bot commented Jul 28, 2026 •

Copy link
Copy Markdown
Contributor

Test Results (shard 3)

 11 files   -  1   11 suites   - 1   2m 35s ⏱️ - 1m 59s
915 tests  - 59  911 ✅  - 59  4 💤 ±0  0 ❌ ±0 
978 runs   - 59  974 ✅  - 59  4 💤 ±0  0 ❌ ±0 

Results for commit 5cdf109. ± Comparison against base commit f359385.

This pull request removes 59 tests.
MeshWeaver.FutuRe.Test.FutuReAnalysisTest ‑ ActivityLogs_ShouldBeQueryableViaMeshQuery
MeshWeaver.FutuRe.Test.FutuReAnalysisTest ‑ AllNodeTypes_ShouldExist
MeshWeaver.FutuRe.Test.FutuReAnalysisTest ‑ AmericasIns_Overview_ShouldRender
MeshWeaver.FutuRe.Test.FutuReAnalysisTest ‑ AmountTypes_ShouldLoadFromMeshNodes
MeshWeaver.FutuRe.Test.FutuReAnalysisTest ‑ AnnualReport_EmbeddedCharts_ShouldRenderViaPathResolution
MeshWeaver.FutuRe.Test.FutuReAnalysisTest ‑ AnnualReport_Overview_ShouldContainLayoutAreaReferences
MeshWeaver.FutuRe.Test.FutuReAnalysisTest ‑ AnnualReport_Overview_ShouldRender
MeshWeaver.FutuRe.Test.FutuReAnalysisTest ‑ AsiaRe_Overview_ShouldRender
MeshWeaver.FutuRe.Test.FutuReAnalysisTest ‑ BusinessUnits_ShouldExistWithProperties
MeshWeaver.FutuRe.Test.FutuReAnalysisTest ‑ Countries_ShouldLoadFromMeshNodes
…

♻️ This comment has been updated with latest results.

@github-actions

Copy link
Copy Markdown
Contributor

Test Results (shard 0)

959 tests  ±0   953 ✅ ±0   4m 57s ⏱️ -21s
  5 suites ±0     6 💤 ±0 
  5 files   ±0     0 ❌ ±0 

Results for commit 5cdf109. ± Comparison against base commit f359385.

@github-actions

Copy link
Copy Markdown
Contributor

Test Results (shard 2)

1 129 tests  ±0   1 026 ✅ ±0   5m 19s ⏱️ +20s
   10 suites ±0     103 💤 ±0 
   10 files   ±0       0 ❌ ±0 

Results for commit 5cdf109. ± Comparison against base commit f359385.

@github-actions

Copy link
Copy Markdown
Contributor

Test Results (shard 5)

1 142 tests  ±0   1 141 ✅ ±0   6m 34s ⏱️ +2s
   12 suites ±0       1 💤 ±0 
   12 files   ±0       0 ❌ ±0 

Results for commit 5cdf109. ± Comparison against base commit f359385.

@github-actions

Copy link
Copy Markdown
Contributor

Test Results (shard 1)

1 184 tests  ±0   1 183 ✅ ±0   7m 20s ⏱️ +11s
   10 suites ±0       1 💤 ±0 
   10 files   ±0       0 ❌ ±0 

Results for commit 5cdf109. ± Comparison against base commit f359385.

@github-actions

Copy link
Copy Markdown
Contributor

Test Results (shard 4)

1 997 tests  ±0   1 809 ✅ ±0   5m 12s ⏱️ +3s
   12 suites ±0     188 💤 ±0 
   12 files   ±0       0 ❌ ±0 

Results for commit 5cdf109. ± Comparison against base commit f359385.

@github-actions

github-actions Bot commented Jul 28, 2026 •

Copy link
Copy Markdown
Contributor

Test Results

   60 files   -  1     60 suites   - 1   32m 0s ⏱️ - 1m 43s
7 326 tests  - 59  7 023 ✅  - 59  303 💤 ±0  0 ❌ ±0 
7 389 runs   - 59  7 086 ✅  - 59  303 💤 ±0  0 ❌ ±0 

Results for commit 5cdf109. ± Comparison against base commit f359385.

This pull request removes 59 tests.
MeshWeaver.FutuRe.Test.FutuReAnalysisTest ‑ ActivityLogs_ShouldBeQueryableViaMeshQuery
MeshWeaver.FutuRe.Test.FutuReAnalysisTest ‑ AllNodeTypes_ShouldExist
MeshWeaver.FutuRe.Test.FutuReAnalysisTest ‑ AmericasIns_Overview_ShouldRender
MeshWeaver.FutuRe.Test.FutuReAnalysisTest ‑ AmountTypes_ShouldLoadFromMeshNodes
MeshWeaver.FutuRe.Test.FutuReAnalysisTest ‑ AnnualReport_EmbeddedCharts_ShouldRenderViaPathResolution
MeshWeaver.FutuRe.Test.FutuReAnalysisTest ‑ AnnualReport_Overview_ShouldContainLayoutAreaReferences
MeshWeaver.FutuRe.Test.FutuReAnalysisTest ‑ AnnualReport_Overview_ShouldRender
MeshWeaver.FutuRe.Test.FutuReAnalysisTest ‑ AsiaRe_Overview_ShouldRender
MeshWeaver.FutuRe.Test.FutuReAnalysisTest ‑ BusinessUnits_ShouldExistWithProperties
MeshWeaver.FutuRe.Test.FutuReAnalysisTest ‑ Countries_ShouldLoadFromMeshNodes
…

♻️ This comment has been updated with latest results.

@rbuergi

rbuergi commented Jul 28, 2026

Copy link
Copy Markdown
Contributor Author

Correction to my own framing: raising budgets is a treadmill, not a cure

This PR's CI failed on a test I did not touch and had not catalogued — FutuReAnalysisTest.EuropeRe_AnnualProfitabilityWaterfall_ShouldRender — and its failure is the important one:

Test execution timed out after 30000 milliseconds
[05:18:35.376] === TEST CLASS INIT: FutuReAnalysisTest ===

It already carried [Fact(Timeout = 30000)], and it still consumed the entire 30 s in fixture startup. So the progression is 10 s → 30 s → still red. Widening the budget moves the line; it does not cross it.

That sharpens the conclusion in the commit message, and I want it recorded plainly rather than buried:

  • What this PR legitimately fixes stands: [HubFact]'s 5 s Release budget and MeshNodeVersionSyncTest's 10 s are unmeetable — an 8.1 s mesh fixture cannot fit in either, so those tests were measuring the runner. Raising them to the runner-wide 30 s removes two false failures.
  • What it does not fix, and cannot: the tail. FutuRe at 30 s, ThreadAgentIntegrationTest with GetMeshNode … NO LOCAL HUB … it never activated here, TwoSiloRecycleConvergence, TwoWaySync — these are the cold-hub-activation defect (#686: identical NodeType shape compiles with 0 ms discovery on a fresh mesh, 45.20 s on memex) reproducing under CI load.

I am deliberately not raising FutuRe's budget to 60 s. That would make main greener while deleting the clearest reproduction of the production bug we have. The honest state is: two test-side flakes fixed, and the rest correctly identified as one product defect that CI is reproducing for free.

Re-ran the failed shard to confirm this PR's change is not implicated.

Catalogued every red main run of the last two days from the check annotations. Four
named flakes, and none of them is a bad assertion — all four are timeouts, and at
least two are timeouts a correct test could never have avoided:

  MeshNodeVersionSyncTest.MeshNode_InitialVersion_IsZero
    "Test execution timed out after 10000 milliseconds", and the same log shows
    class init 19:59:22.595 → dispose 19:59:30.720 — 8.1s of MESH FIXTURE inside a
    10s budget, leaving 1.9s for the body. On a quiet runner it fits; under an
    8-shard load it does not. The test measures the runner, not the code.

  [HubFact] carried the same trap globally: 5s in Release (CI), which the fixture
  alone can exceed. It bit a heartbeat test written the same night — green locally,
  where no budget is enforced, and impossible on CI.

So both budgets move to 30s, matching the runner-wide methodTimeout. Nothing is
masked: a genuine wedge surfaces its own "GetMeshNode … timed out after 60.0s"
first, so a hang still fails — just not before the fixture has finished starting.

Not fixed here, and NOT the same class — recorded so they are not mistaken for
budget noise:

  TwoSiloRecycleConvergenceTest.PostRecycleUpdate_NonOwnerSiloMirror_Converges  (2 runs)
  TwoWaySyncTest.TwoWay_Update_KeepsServerAddition_UnlessForced
  ThreadAgentIntegrationTest.FullFlow_CreateThread_SendMessage_NonStreaming

The last one is the most interesting: it fails with
"GetMeshNode('ACME/ProductLaunch') timed out after 60.0s — the owning per-node hub
never answered … NO LOCAL HUB … it never activated here". That is the SAME
cold-hub-activation defect measured in production this week (issue #686: 0ms source
discovery on a fresh mesh, 45.20s on memex). These flakes are that bug reproducing
under CI load, not test debt.

409/409 Persistence, 290/290 Data.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@rbuergi
rbuergi merged commit bc9906b into main Jul 29, 2026
1 check passed
@rbuergi
rbuergi deleted the fix/main-flakes branch July 29, 2026 00:05
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.

2 participants