Add a test network setup and patch for E2E tests #18

Merged
ashwin merged 2 commits from pm-patch-test-network into main 2024-03-07 12:36:00 +00:00
2 changed files with 12 additions and 6 deletions
Showing only changes of commit 436455b263 - Show all commits

View File

@ -64,3 +64,9 @@ A typical testing flow might look like the following:
}
*/
package network
/*
NOTE:
Copied over from https://github.com/cosmos/cosmos-sdk/tree/v0.50.3/testutil/network
Patch: Skipped network.LatestHeight() call at the end of New()
*/

View File

@ -619,12 +619,12 @@ func New(l Logger, baseDir string, cfg Config) (*Network, error) {
l.Log("started validator", idx)
}
height, err := network.LatestHeight()
if err != nil {
return nil, err
}
// height, err := network.LatestHeight()
// if err != nil {
// return nil, err
// }
l.Log("started test network at height:", height)
// l.Log("started test network at height:", height)
// Ensure we cleanup incase any test was abruptly halted (e.g. SIGINT) as any
// defer in a test would not be called.
@ -745,7 +745,7 @@ func (n *Network) WaitForHeightWithTimeout(h int64, t time.Duration) (int64, err
// blocks has been reached.
func (n *Network) RetryForBlocks(retryFunc func() error, blocks int) error {
for i := 0; i < blocks; i++ {
n.WaitForNextBlock()
_ = n.WaitForNextBlock()
err := retryFunc()
if err == nil {
return nil