Skip to content

test(sync): SameValuePatchKeepsTheChainTest waits on conditions, not clocks (#3530 follow-up) - #3531

Merged
meshweaver-cloud[bot] merged 1 commit into
mainfrom
fix/3530-test-hygiene
Sep 7, 2026
Merged

meshweaver-cloud[bot] merged 1 commit into
mainfrom
fix/3530-test-hygiene

Conversation

@rbuergi

@rbuergi rbuergi commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Follow-up to #3530 (merged as b75f501 while the two Copilot review comments were still open — the queued branch refused the push).

  • The fixed Task.Delay waits become bounded waits on the observable facts (a frame was posted; the subscription replayed) under TestTimeouts.Convergence.
  • Payload disposes its JsonDocument after cloning the root.

No behaviour change; the test still fails on the pre-#3530 code with a second SubscribeRequest.

🤖 Generated with Claude Code

…t parses

Copilot's two nits: the fixed Task.Delay waits become bounded waits on the observable facts
(a frame was posted; the subscription replayed) under TestTimeouts.Convergence, and Payload
disposes its JsonDocument after cloning the root.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings September 7, 2026 05:30
@meshweaver-cloud
meshweaver-cloud Bot enabled auto-merge September 7, 2026 05:30

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.

🟡 Changes recommended

It introduces an unsafe TaskCompletionSource construction (missing RunContinuationsAsynchronously) that can inline-resume continuations and create scheduler-holding/reentrancy hazards.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Follow-up test hardening for the sync regression covered in #3530/#3520, replacing clock-based sleeps with bounded waits on observable conditions and ensuring JSON payload creation doesn’t keep JsonDocument alive longer than needed.

Changes:

  • Dispose JsonDocument in Payload(...) after cloning the root element.
  • Replace Task.Delay sleeps with bounded waits on observable facts (posted advancing / subscription replay completing) under TestTimeouts.Convergence.
File summaries
File Description
test/MeshWeaver.Data.Test/SameValuePatchKeepsTheChainTest.cs Replaces fixed sleeps with condition-based waits and fixes JsonDocument lifetime in payload helper.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

using var emissions = mirror.Subscribe(_ => Interlocked.Increment(ref emitted));
await Task.Delay(200); // the subscription replays the current value; count only what follows
Interlocked.Exchange(ref emitted, 0);
var replayed = new TaskCompletionSource();
@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Test Results (shard 1)

492 tests   492 ✅  31s ⏱️
  1 suites    0 💤
  1 files      0 ❌

Results for commit 3687eb6.

@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Test Results (shard 0)

251 tests   251 ✅  2m 33s ⏱️
  1 suites    0 💤
  1 files      0 ❌

Results for commit 3687eb6.

@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Test Results (shard 3)

1 034 tests   1 034 ✅  1m 11s ⏱️
    2 suites      0 💤
    2 files        0 ❌

Results for commit 3687eb6.

@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Test Results (shard 4)

1 600 tests   1 406 ✅  2m 5s ⏱️
    4 suites    194 💤
    4 files        0 ❌

Results for commit 3687eb6.

@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Test Results (shard 5)

    5 files      5 suites   2m 7s ⏱️
1 473 tests 1 473 ✅ 0 💤 0 ❌
1 474 runs  1 474 ✅ 0 💤 0 ❌

Results for commit 3687eb6.

@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Test Results (shard 2)

1 079 tests   1 079 ✅  3m 28s ⏱️
    3 suites      0 💤
    3 files        0 ❌

Results for commit 3687eb6.

@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Test Results

   16 files     16 suites   11m 56s ⏱️
5 929 tests 5 735 ✅ 194 💤 0 ❌
5 930 runs  5 736 ✅ 194 💤 0 ❌

Results for commit 3687eb6.

@meshweaver-cloud
meshweaver-cloud Bot added this pull request to the merge queue Sep 7, 2026
Merged via the queue into main with commit 75a062f Sep 7, 2026
30 checks passed
@rbuergi
rbuergi deleted the fix/3530-test-hygiene branch October 10, 2026 13:10
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