Skip to content

ScopeDescendants asserts the shape, not an exact emission count (#946) - #955

Merged
rbuergi merged 1 commit into
mainfrom
fix/ci-flake-pair
Aug 8, 2026
Merged

rbuergi merged 1 commit into
mainfrom
fix/ci-flake-pair

Conversation

@rbuergi

@rbuergi rbuergi commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Fixes #946.

The flake, and why it was the pipeline's top blocker today

ScopeDescendants_NotifiesOnAllDescendantChanges waited for >= 3 distinct Added paths, then asserted HaveCount(3) exactly. scope:descendants matches anything created under the root — so one extra descendant landing inside that window (a satellite the framework writes for the new nodes, timing-dependent under load) turns a correct system into a red build.

It hit four unrelated PRs today — #927, #940, #942, #947 — always shard 1, always passing locally. Each occurrence blocked a green PR and burned a CI cycle.

Why this is the test's bug, not the product's

AGENTS.md already forbids this exact shape:

Never assert "exactly N change events" on a stream backed by pg_notify or any change feed that can race the initial-snapshot path. Filter on the emission shape, not the count.

The test now asserts what it means: each of the three created descendants emitted an Added change. Extra descendants are explicitly allowed, because the scope legitimately matches them.

Deliberately not changed

Sibling assertions in the same class count emissions to prove a negative ("sibling create must not emit for ancestors scope") — there a bound is the assertion, and none of them has flaked. Changing passing tests without evidence is its own risk; the commit notes the pattern so it's visible if one of them starts.

ObservableQueryIntegrationTests 9/9 locally. No What's New — test-only.

🤖 Generated with Claude Code

Fixes #946. ScopeDescendants_NotifiesOnAllDescendantChanges waited for >= 3
distinct Added paths and then asserted HaveCount(3) EXACTLY. `scope:descendants`
matches anything created under the root, so one extra descendant landing inside
that window — a satellite the framework writes for the new nodes, which is
timing-dependent under load — turned a correct system into a red build.

That made it the top flake of 2026-08-08: four unrelated PRs (#927, #940, #942,
#947), always shard 1, always passing locally. AGENTS.md already forbids exactly
this ("Never assert 'exactly N change events' on a stream backed by a change
feed that can race the initial-snapshot path — filter on the emission shape").

The test now asserts what it actually means: each of the three created
descendants emitted an Added change. Extra descendants are explicitly allowed,
because the scope legitimately matches them.

Left alone deliberately: the sibling assertions in this class that count
emissions to prove a NEGATIVE ("sibling create must not emit for ancestors
scope") — a bound is the point there, and none of them has flaked. Changing
passing tests without evidence is its own risk; noted here so the pattern is
visible if one of them starts.

ObservableQueryIntegrationTests 9/9.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings August 8, 2026 10:03

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

Updates the ScopeDescendants_NotifiesOnAllDescendantChanges integration test to assert the presence of the three expected descendant Added paths rather than asserting an exact emission/item count, eliminating a load-dependent CI flake while preserving the intended liveness contract of scope:descendants.

Changes:

  • Replace exact-count assertions with set-based containment checks for the three explicitly created descendant paths.
  • Make the wait condition in the test predicate depend on “all expected paths observed” instead of “>= N emissions then count == N”.

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

@github-actions

github-actions Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Test Results (shard 1)

1 192 tests  ±0   1 192 ✅ ±0   5m 24s ⏱️ -15s
   11 suites ±0       0 💤 ±0 
   11 files   ±0       0 ❌ ±0 

Results for commit 89eb24c. ± Comparison against base commit d87cd69.

@github-actions

github-actions Bot commented Aug 8, 2026 •

Copy link
Copy Markdown
Contributor

Test Results (shard 0)

685 tests  ±0   685 ✅ ±0   5m 5s ⏱️ -13s
 10 suites ±0     0 💤 ±0 
 10 files   ±0     0 ❌ ±0 

Results for commit 89eb24c. ± Comparison against base commit d87cd69.

♻️ This comment has been updated with latest results.

@github-actions

github-actions Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Test Results (shard 5)

1 676 tests  ±0   1 485 ✅ ±0   5m 49s ⏱️ -1s
   11 suites ±0     191 💤 ±0 
   11 files   ±0       0 ❌ ±0 

Results for commit 89eb24c. ± Comparison against base commit d87cd69.

@github-actions

github-actions Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Test Results (shard 3)

   11 files  ±0     11 suites  ±0   5m 13s ⏱️ +3s
1 839 tests ±0  1 733 ✅ ±0  106 💤 ±0  0 ❌ ±0 
1 942 runs  ±0  1 836 ✅ ±0  106 💤 ±0  0 ❌ ±0 

Results for commit 89eb24c. ± Comparison against base commit d87cd69.

@github-actions

github-actions Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Test Results (shard 4)

1 166 tests  ±0   1 159 ✅ ±0   7m 2s ⏱️ + 1m 48s
   11 suites ±0       7 💤 ±0 
   11 files   ±0       0 ❌ ±0 

Results for commit 89eb24c. ± Comparison against base commit d87cd69.

@github-actions

github-actions Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Test Results (shard 2)

1 811 tests  ±0   1 809 ✅ ±0   8m 39s ⏱️ +5s
   11 suites ±0       2 💤 ±0 
   11 files   ±0       0 ❌ ±0 

Results for commit 89eb24c. ± Comparison against base commit d87cd69.

@github-actions

github-actions Bot commented Aug 8, 2026 •

Copy link
Copy Markdown
Contributor

Test Results

   65 files  ±0     65 suites  ±0   37m 15s ⏱️ + 1m 27s
8 369 tests ±0  8 063 ✅ ±0  306 💤 ±0  0 ❌ ±0 
8 472 runs  ±0  8 166 ✅ ±0  306 💤 ±0  0 ❌ ±0 

Results for commit 89eb24c. ± Comparison against base commit d87cd69.

♻️ This comment has been updated with latest results.

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.

CI: ObservableQueryIntegrationTests.ScopeDescendants_NotifiesOnAllDescendantChanges fails on loaded shards, always shard 1

2 participants