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

test: more e2e upgrade testing #1458

Merged
merged 24 commits into from
May 16, 2022
Merged

test: more e2e upgrade testing #1458

merged 24 commits into from
May 16, 2022

Conversation

czarcas7ic
Copy link
Member

@czarcas7ic czarcas7ic commented May 10, 2022

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

  • Created IBC send and pool creation functions
    • These function are called pre upgrade to create state and post upgrade to test if it still works as intended
  • Adds four pool json files required for pool creation command
  • Submit, deposit, vote, chain height, and query utility functions created
  • Now required code 0 (success) from chain. Before only checked that the commands were sent successfully to the docker container which is only half the picture.
  • Modified the ibc send test so that it will pass regardless of what order it is called in.
  • Bug fixes to allow for a variety of validator combinations

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

  • Does this pull request introduce a new feature or user-facing behavior changes? no
  • Is a relevant changelog entry added to the Unreleased section in CHANGELOG.md? not yet

@czarcas7ic czarcas7ic requested a review from a team May 10, 2022 03:17
@codecov-commenter
Copy link

codecov-commenter commented May 10, 2022

Codecov Report

Merging #1458 (ddc5137) into main (f149135) will not change coverage.
The diff coverage is n/a.

@@           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.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f149135...ddc5137. Read the comment docs.

tests/e2e/chain/config.go Outdated Show resolved Hide resolved
tests/e2e/chain/config.go Outdated Show resolved Hide resolved
tests/e2e/e2e_setup_test.go Outdated Show resolved Hide resolved
tests/e2e/e2e_setup_test.go Outdated Show resolved Hide resolved
Copy link
Member

@p0mvn p0mvn left a 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/scripts/pool1A.json Outdated Show resolved Hide resolved
tests/e2e/e2e_setup_test.go Outdated Show resolved Hide resolved
tests/e2e/e2e_setup_test.go Show resolved Hide resolved
tests/e2e/e2e_util_test.go Outdated Show resolved Hide resolved
tests/e2e/e2e_util_test.go Outdated Show resolved Hide resolved
tests/e2e/e2e_setup_test.go Outdated Show resolved Hide resolved
tests/e2e/e2e_setup_test.go Outdated Show resolved Hide resolved
// 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)
Copy link
Member

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

Copy link
Member Author

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?

Copy link
Member

Choose a reason for hiding this comment

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

}
}
// upgrade to locally compiled binary concurently
wg.Add(2)
Copy link
Member

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

Copy link
Member Author

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.

Copy link
Member

Choose a reason for hiding this comment

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

tests/e2e/e2e_test.go Show resolved Hide resolved
Copy link
Member Author

@czarcas7ic czarcas7ic left a 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 Show resolved Hide resolved
// 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)
Copy link
Member Author

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?

tests/e2e/e2e_setup_test.go Outdated Show resolved Hide resolved
tests/e2e/e2e_setup_test.go Outdated Show resolved Hide resolved
if currentHeight == propHeight {
counter++
}
return counter == 3
Copy link
Member Author

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

}
}
// upgrade to locally compiled binary concurently
wg.Add(2)
Copy link
Member Author

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.

tests/e2e/e2e_test.go Show resolved Hide resolved
tests/e2e/e2e_util_test.go Show resolved Hide resolved
tests/e2e/e2e_util_test.go Outdated Show resolved Hide resolved
tests/e2e/e2e_util_test.go Show resolved Hide resolved
Comment on lines 396 to 404
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])
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
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 alexanderbez self-assigned this May 11, 2022
@czarcas7ic czarcas7ic requested review from p0mvn and alexanderbez May 12, 2022 19:08
@czarcas7ic
Copy link
Member Author

czarcas7ic commented May 12, 2022

@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 {
Copy link
Contributor

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.

@czarcas7ic czarcas7ic merged commit 9463346 into main May 16, 2022
@czarcas7ic czarcas7ic deleted the adam/e2e-changes-2 branch May 16, 2022 16:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

5 participants