Skip to content

fix: stabilize flaky TestLeaderHint tests#916

Merged
mattisonchao merged 1 commit intomainfrom
fix/flaky-leader-hint-tests
Feb 26, 2026
Merged

fix: stabilize flaky TestLeaderHint tests#916
mattisonchao merged 1 commit intomainfrom
fix/flaky-leader-hint-tests

Conversation

@mattisonchao
Copy link
Copy Markdown
Member

Summary

  • Fix flaky TestLeaderHintWithClient and TestLeaderHintWithoutClient that intermittently fail with EOF / "node is not leader" errors
  • Both tests only waited for shard.Leader != nil (with a 1s timeout), which is insufficient — the cluster may still be in election state with followers not yet having received shard assignments via the dispatcher
  • Wait for ShardStatusSteadyState (with a 10s timeout) before performing operations, matching the established pattern used across all other integration tests

Test plan

  • go vet ./tests/assignments/... passes
  • CI passes

🤖 Generated with Claude Code

…utClient

Wait for ShardStatusSteadyState with a leader present instead of just
leader election before performing operations. The previous check
(shard.Leader != nil with 1s timeout) was insufficient — followers may
not have received shard assignments yet, causing EOF and "node is not
leader" errors.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@mattisonchao mattisonchao force-pushed the fix/flaky-leader-hint-tests branch from ab83cb3 to 0608213 Compare February 26, 2026 08:30
@mattisonchao mattisonchao self-assigned this Feb 26, 2026
@mattisonchao mattisonchao merged commit 1fc5412 into main Feb 26, 2026
11 of 12 checks passed
@mattisonchao mattisonchao deleted the fix/flaky-leader-hint-tests branch February 26, 2026 16:52
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.

1 participant