-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Add more RAFT tests #4626
base: main
Are you sure you want to change the base?
Add more RAFT tests #4626
Conversation
76267e5
to
6789d2d
Compare
6789d2d
to
e92592e
Compare
e2744a4
to
7950364
Compare
a73cbc3
to
7eb306e
Compare
Chain of Blocks is a simple state machine on top of Raft/NRG. Values delivered through Raft are hashed allowing for easy verification of replicas divergence. - Add one happy-path test - Add one test for recovery/catchup - Add a 'Long' randomized test
7eb306e
to
fc3553a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One comment, otherwise LGTM
sm.Lock() | ||
defer sm.Unlock() | ||
sm.n.Stop() | ||
sm.wg.Wait() | ||
|
||
// Clear state, on restart it will be recovered from snapshot or peers |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When running locally it seems the test can lock up and not do anything/exceed the test duration.
Should be fixed by not holding the lock while waiting for Stop/Wait
to complete The same logic is used in stateAdder.stop()
.
sm.Lock() | |
defer sm.Unlock() | |
sm.n.Stop() | |
sm.wg.Wait() | |
// Clear state, on restart it will be recovered from snapshot or peers | |
n, wg := sm.node(), sm.waitGroup() | |
n.Stop() | |
n.WaitForStop() | |
wg.Wait() | |
// Clear state, on restart it will be recovered from snapshot or peers | |
sm.Lock() | |
defer sm.Unlock() |
Add 'Chain of Blocks' tests for Raft/NRG
Chain of Blocks is a simple state machine on top of Raft/NRG.
Values delivered through Raft are hashed allowing for easy verification of replicas divergence.
Signed-off-by: [email protected]