Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

De-flake RAFT state adder tests #6239

Merged
merged 1 commit into from
Dec 10, 2024
Merged

Conversation

MauriceVanVeen
Copy link
Member

@MauriceVanVeen MauriceVanVeen commented Dec 10, 2024

Fixes TestNRGHeartbeatOnLeaderChange by checking if new entries are actually being applied. This was not possible before because it would always check a total of 0. If all proposals would fail, this test would still pass.

More importantly a.sum was not reset, which meant that state before the call to restart() would be preserved, and replayed entries during catchup/recovery would be re-applied.

Also added a call to a.n.WaitForStop() in a.stop(). Otherwise things could still be around and not properly stopped when we restart with a.restart().

Signed-off-by: Maurice van Veen github@mauricevanveen.com

@MauriceVanVeen MauriceVanVeen requested a review from a team as a code owner December 10, 2024 20:00
Copy link
Member

@wallyqs wallyqs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@MauriceVanVeen MauriceVanVeen marked this pull request as draft December 10, 2024 20:22
@MauriceVanVeen
Copy link
Member Author

Seems the test can still flake, turning into draft for a bit.

Signed-off-by: Maurice van Veen <github@mauricevanveen.com>
@MauriceVanVeen MauriceVanVeen force-pushed the maurice/de-flake-state-adder branch from 98477a8 to 00f3b5f Compare December 10, 2024 21:06
@MauriceVanVeen MauriceVanVeen marked this pull request as ready for review December 10, 2024 21:35
@MauriceVanVeen
Copy link
Member Author

Seems to not flake anymore after adding a call to a.n.WaitForStop() in a.stop().

@derekcollison derekcollison merged commit a3a6551 into main Dec 10, 2024
5 checks passed
@derekcollison derekcollison deleted the maurice/de-flake-state-adder branch December 10, 2024 21:42
wallyqs added a commit that referenced this pull request Dec 13, 2024
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.

3 participants