Skip to content

Tolerate consensus apply timeouts in test_rejoin_cluster create loops - #8950

Merged
generall merged 1 commit into
devfrom
fix/test-rejoin-cluster-flaky-create-timeout
May 7, 2026
Merged

generall merged 1 commit into
devfrom
fix/test-rejoin-cluster-flaky-create-timeout

Conversation

@generall

@generall generall commented May 7, 2026 •

Copy link
Copy Markdown
Member

Summary

The test_rejoin_cluster[True/False] test is flaky on CI. The rapid drop/create loops use intentionally short 3s timeouts to accumulate Raft log entries quickly, but under CI I/O load the consensus apply for CreateCollection can exceed 3s while segment setup competes with background flushes from test_collection2. The API then returns 500 even though the consensus operation commits and applies right after.

Concrete trace from a recent failure: WAL append at T+0.13s, hard-state commit at T+0.17s, Creating collection log at T+0.49s, segment loads finish at T+2.16s, then a ~1.85s gap with only background test_collection2 flushes, then the timeout fires at T+3.97s — followed 47ms later by Successfully applied consensus operation entry. Index: 81. Result: true.

The matching upsert_random_points calls in the same loops already pass fail_on_error=False. This PR threads the same flag through create_collection and uses it for the two rapid-fire loops. Final assertions (wait_for_all_replicas_active(..., "test_collection2")) still validate the rejoin behavior end-to-end.

Test plan

  • CI: test_rejoin_cluster[True] and test_rejoin_cluster[False] pass
  • Other consensus tests still pass (unchanged callers all pass fail_on_error defaulted to True)

🤖 Generated with Claude Code

The rapid drop/create loops in test_rejoin_cluster intentionally use
short 3s timeouts to accumulate Raft log entries quickly. Under CI
load the consensus apply for CreateCollection can exceed 3s (segment
setup competes with background flushes/optimizations), and the API
returns 500 even though the operation reaches consensus right after.
The matching upserts already pass `fail_on_error=False`; do the same
for `create_collection` to make the test resilient to that race.
coderabbitai[bot]

This comment was marked as resolved.

@generall
generall merged commit 03cb330 into dev May 7, 2026
15 checks passed
@generall
generall deleted the fix/test-rejoin-cluster-flaky-create-timeout branch May 7, 2026 20:50
@qdrant qdrant deleted a comment from coderabbitai Bot May 8, 2026
timvisee pushed a commit that referenced this pull request May 8, 2026
…#8950)

The rapid drop/create loops in test_rejoin_cluster intentionally use
short 3s timeouts to accumulate Raft log entries quickly. Under CI
load the consensus apply for CreateCollection can exceed 3s (segment
setup competes with background flushes/optimizations), and the API
returns 500 even though the operation reaches consensus right after.
The matching upserts already pass `fail_on_error=False`; do the same
for `create_collection` to make the test resilient to that race.
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