-
Notifications
You must be signed in to change notification settings - Fork 2
Add Test Suite for Long Running Tests #314
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
base: main
Are you sure you want to change the base?
Changes from all commits
a64f705
3986c99
fcde8df
db7c4d9
b4e9e04
ac0dbb1
b5ec286
444aa40
c125e5c
f964eaf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| // Copyright (C) 2019-2025, Ava Labs, Inc. All rights reserved. | ||
| // See the file LICENSE for licensing terms. | ||
|
|
||
| package simplex_test | ||
|
|
||
| import ( | ||
| "math" | ||
| "testing" | ||
|
|
||
| "github.com/ava-labs/simplex/testutil" | ||
| ) | ||
|
|
||
| func TestLongRunningSimple(t *testing.T) { | ||
| net := testutil.NewDefaultLongRunningNetwork(t, 5) | ||
|
|
||
| net.StartInstances() | ||
| net.WaitForNodesToEnterRound(40) | ||
| net.StopAndAssert(false) | ||
| } | ||
|
|
||
| func TestLongRunningReplication(t *testing.T) { | ||
| net := testutil.NewDefaultLongRunningNetwork(t, 10) | ||
| for _, instance := range net.Instances { | ||
| instance.SilenceExceptKeywords("Received replication response", "Resending replication requests for missing rounds/sequences") | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't understand why we're doing this. There is nothing in the test that I see that requires intercepting the log, so why do we care that it's printed? Can you explain? |
||
| } | ||
| net.StartInstances() | ||
|
|
||
| net.WaitForNodesToEnterRound(40) | ||
samliok marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| net.NoMoreBlocks() | ||
| net.DisconnectNodes(2) | ||
| net.ContinueBlocks() | ||
| net.WaitForNodesToEnterRound(70, 1, 3, 4, 5, 6) | ||
| net.DisconnectNodes(4) | ||
| net.WaitForNodesToEnterRound(90, 1, 3, 5, 6, 7, 8, 9) | ||
| net.ConnectNodes(2, 4) | ||
| net.WaitForNodesToEnterRound(150) | ||
| net.StopAndAssert(false) | ||
| } | ||
|
|
||
| func TestLongRunningCrash(t *testing.T) { | ||
| net := testutil.NewDefaultLongRunningNetwork(t, 10) | ||
| for i, instance := range net.Instances { | ||
| if i == 3 { | ||
| instance.SilenceExceptKeywords("WAL") | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't understand why we're silencing the logs. Is that to make the test less flaky or something? And why aren't we silencing the WAL pattern here? |
||
| continue | ||
| } | ||
| instance.Silence() | ||
| } | ||
|
|
||
| net.StartInstances() | ||
| net.WaitForNodesToEnterRound(30) | ||
| net.CrashNodes(3) | ||
| crashedNodeLatestBlock := net.Instances[3].Storage.NumBlocks() | ||
|
|
||
| net.WaitForNodesToEnterRound(80, 1, 2, 4, 5, 6, 7, 8, 9) | ||
| net.RestartNodes(3) | ||
|
|
||
| waitForRound := math.Max(float64(crashedNodeLatestBlock*2), 150) | ||
| net.WaitForNodesToEnterRound(uint64(waitForRound)) | ||
| net.StopAndAssert(false) | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.