test: wait for readiness instead of sleeping in TestTrivialERS#96
Draft
cursor[bot] wants to merge 1 commit intomainfrom
Draft
test: wait for readiness instead of sleeping in TestTrivialERS#96cursor[bot] wants to merge 1 commit intomainfrom
cursor[bot] wants to merge 1 commit intomainfrom
Conversation
Signed-off-by: Cursor Agent <cursoragent@cursor.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.
Description
I inspected the latest successful
mainruns for bothunit_test.ymlandcluster_endtoend.ymlinvitessio/vitessand found the cluster workflow was the real wall-clock bottleneck. In run23057103687, the slowest job wasers_prs_newfeatures_heavyat about24m17s, noticeably slower than any job in the latest successful unit-test run.Within that shard,
go/test/endtoend/reparent/emergencyreparentwas a major contributor at about8m21s, andTestTrivialERSalone took about62.97s. The biggest avoidable cost in that test was eight unconditionaltime.Sleep(5 * time.Second)calls between repeated ERS invocations.This PR replaces those fixed sleeps with a readiness check that waits for:
That keeps the same end-to-end assertion intact — repeated ERS operations must leave the shard healthy and replicating — while removing idle wait time.
I also checked open PRs before making this change. I did not find an open PR already addressing
TestTrivialERSor theers_prs_newfeatures_heavyshard specifically; the closest related open PR I saw was#19622, which focuses on e2e teardown/orphaned processes rather than this test’s fixed waits.Local validation:
go test -count=1 -timeout 15m -run '^TestTrivialERS$' vitess.io/vitess/go/test/endtoend/reparent/emergencyreparent61.383s31.282sgo test -count=1 -timeout 25m vitess.io/vitess/go/test/endtoend/reparent/emergencyreparent453.887s(7m33.887s)8m21.062sRelated Issue(s)
None.
Checklist
Deployment Notes
None.
AI Disclosure
This PR was written primarily by GPT-5.