Reduce flakiness of cluster_chaos_test (#4878)#4882
Open
tillrohrmann wants to merge 1 commit into
Open
Conversation
The CI failure is most plausibly explained by recovery after a single node restart taking longer than the previous 10s `expected_recovery_interval` — gossip's `Suspect -> Alive` transitions (5s default) plus cluster-controller leader thrashing can push it past that bound. This is a hypothesis based on the logs; we have not reproduced it locally. The changes here aim to make the test resilient to this and a couple of other timing footguns: 1. Override `gossip_suspect_interval` to 1s in the test config and raise the budgets to 60s / 30s so a normal full-stack recovery has comfortable headroom. 2. Pre-build one reqwest client per ingress with a 5s timeout. The client was previously rebuilt every iteration with no timeout, so a request hung against a node mid-shutdown could stall the loop. 3. Race the request against `&mut chaos_handle` in a biased `tokio::select!`. Previously, if the chaos task errored out, the main loop kept spinning for the rest of `chaos_duration` and panicked on `successful writes: 0`, hiding the actual error message. Now the chaos error surfaces immediately. No production behavior changes. This fixes restatedev#4878. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The CI failure is most plausibly explained by recovery after a single node restart taking longer than the previous 10s
expected_recovery_interval— gossip'sSuspect -> Alivetransitions (5s default) plus cluster-controller leader thrashing can push it past that bound. This is a hypothesis based on the logs; we have not reproduced it locally. The changes here aim to make the test resilient to this and a couple of other timing footguns:gossip_suspect_intervalto 1s in the test config and raise the budgets to 60s / 30s so a normal full-stack recovery has comfortable headroom.&mut chaos_handlein a biasedtokio::select!. Previously, if the chaos task errored out, the main loop kept spinning for the rest ofchaos_durationand panicked onsuccessful writes: 0, hiding the actual error message. Now the chaos error surfaces immediately.No production behavior changes.
This fixes #4878.