Skip to content

test(replication): wait for the first fetched file instead of a fixed sleep - #3800

Open
Anurag-S1ngh wants to merge 1 commit into
apache:unstablefrom
Anurag-S1ngh:fix/3527-replication-test-time
Open

Anurag-S1ngh wants to merge 1 commit into
apache:unstablefrom
Anurag-S1ngh:fix/3527-replication-test-time

Conversation

@Anurag-S1ngh

Copy link
Copy Markdown
Contributor

Summary

TestReplicationWithLimitSpeed waited a fixed 5 seconds for the slave to receive "some" SST files before restarting the master. How many files arrive in 5 seconds depends on the machine, and the test only needs the slave to have fetched one file for the resume-and-skip assertion. Waiting for the actual condition removes the fixed delay.

Changes

  • Replace the fixed 5 second sleep with a wait for the slave log to show its first [fetch] Fetched line, then restart the master as before.

Testing

  • go test ./integration/replication locally: 46.55s before, 35.92s after.
  • TestReplicationWithLimitSpeed: 31.38s before, 24.75s after.
  • go test ./integration/replication -count=3 -run TestReplicationWithLimitSpeed to check the condition wait is not flaky.

Part of #3527

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