-
Notifications
You must be signed in to change notification settings - Fork 608
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
test: more e2e upgrade testing #1458
Conversation
Co-authored-by: Roman <[email protected]>
Co-authored-by: Roman <[email protected]>
Codecov Report
@@ Coverage Diff @@
## main #1458 +/- ##
=======================================
Coverage 19.50% 19.50%
=======================================
Files 231 231
Lines 31527 31527
=======================================
Hits 6150 6150
Misses 24251 24251
Partials 1126 1126 Continue to review full report at Codecov.
|
Co-authored-by: Aleksandr Bezobchuk <[email protected]>
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.
Awesome job. Left some comments, please take a look.
The biggest question I have right now is why do we have to do certain things concurrently between chains? Why does it matter?
tests/e2e/e2e_setup_test.go
Outdated
// submit, deposit, and vote for upgrade proposal | ||
s.submitProposal(s.chains[0]) | ||
s.submitProposal(s.chains[1]) | ||
currentHeightA := s.chainHeight(s.valResources[s.chains[0].ChainMeta.Id][0].Container.ID) |
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.
Can we instead move all these calls to a for loop? We can iterate over all chains and do these actions instead of duplicating calls for every chain
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.
Can you point out which lines you are referring to?
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.
tests/e2e/e2e_setup_test.go
Outdated
} | ||
} | ||
// upgrade to locally compiled binary concurently | ||
wg.Add(2) |
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.
Why do we have to do this concurrently?
Also, we should avoid hardcoding and duplicating calls
2 == len(s.chains)
and go s.upgradeContainers(s.chains[0], &wg)
can be done in a loop
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.
Same as before, if we have to upgrade 200 containers I would rather them be done at the same time instead of waiting for each to be finished since they are not dependent on each other.
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.
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.
Thank you so much for the thorough review @p0mvn ! Just had a few questions, the others I will address now!
tests/e2e/e2e_setup_test.go
Outdated
// submit, deposit, and vote for upgrade proposal | ||
s.submitProposal(s.chains[0]) | ||
s.submitProposal(s.chains[1]) | ||
currentHeightA := s.chainHeight(s.valResources[s.chains[0].ChainMeta.Id][0].Container.ID) |
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.
Can you point out which lines you are referring to?
if currentHeight == propHeight { | ||
counter++ | ||
} | ||
return counter == 3 |
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.
The purpose of this was to return True 3 times before accepting it as fact. For instance if upgrade height is 72 its possible to return 72 twice and still hit 73 but 3 seconds is too long to hit the same block 3 times in a row without it having been stopped for upgrade. But this is now moot since we will use a hard chain halt height as suggested by you in your previous comment
tests/e2e/e2e_setup_test.go
Outdated
} | ||
} | ||
// upgrade to locally compiled binary concurently | ||
wg.Add(2) |
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.
Same as before, if we have to upgrade 200 containers I would rather them be done at the same time instead of waiting for each to be finished since they are not dependent on each other.
Co-authored-by: Roman <[email protected]>
tests/e2e/e2e_setup_test.go
Outdated
currentHeightA := s.chainHeight(s.valResources[s.chains[0].ChainMeta.Id][0].Container.ID) | ||
currentHeightB := s.chainHeight(s.valResources[s.chains[1].ChainMeta.Id][0].Container.ID) | ||
propHeightA = currentHeightA + 40 + len(s.chains[0].Validators) | ||
propHeightB = currentHeightB + 40 + len(s.chains[1].Validators) | ||
|
||
s.submitProposal(s.chains[0], propHeightA) | ||
s.submitProposal(s.chains[1], propHeightB) | ||
s.depositProposal(s.chains[0]) | ||
s.depositProposal(s.chains[1]) |
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.
currentHeightA := s.chainHeight(s.valResources[s.chains[0].ChainMeta.Id][0].Container.ID) | |
currentHeightB := s.chainHeight(s.valResources[s.chains[1].ChainMeta.Id][0].Container.ID) | |
propHeightA = currentHeightA + 40 + len(s.chains[0].Validators) | |
propHeightB = currentHeightB + 40 + len(s.chains[1].Validators) | |
s.submitProposal(s.chains[0], propHeightA) | |
s.submitProposal(s.chains[1], propHeightB) | |
s.depositProposal(s.chains[0]) | |
s.depositProposal(s.chains[1]) | |
for _, chain := range chains { | |
currentHeight := s.chainHeight(s.valResources[chain.ChainMeta.Id][0].Container.ID) | |
propHeight := currentHeight + 40 + len(chain.Validators) | |
s.submitProposal(chain, propHeight) | |
s.depositProposal(chain) | |
} |
@alexanderbez @p0mvn I addressed a majority of your comments, however one or two might not be addressed since I re-arranged how some of works now. The most drastic of changes is that IBC sends now continually send until a success code is received. Additionally, there is a check to ensure that IBC send actually arrives on the destination chain before continuing. This has mitigated all issues I was having with account sequence mismatching. Please let me know what you think when you have the time. |
@@ -130,7 +133,7 @@ func addAccount(path, moniker, amountStr string, accAddr sdk.AccAddress) error { | |||
return genutil.ExportGenesisFile(genDoc, genFile) | |||
} | |||
|
|||
func initGenesis(c *internalChain) error { | |||
func initGenesis(c *internalChain, votingPeriod time.Duration) error { |
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.
In the future, this can get messy. We should revise this such that we can instead pass the entire module genesis state. But for now, this is OK.
Completes all required tasks for: #1414
What is the purpose of the change
Adds further functionality to the e2e and upgrade test framework.
Brief Changelog
Testing and Verifying
This change is already covered by the existing e2e test framework and expands upon it. It was also tested locally.
Documentation and Release Note
Unreleased
section inCHANGELOG.md
? not yet