Skip to content

Conversation

ylg-avalabs
Copy link
Contributor

Why this should be merged

  • Allow to reuse network in e2e test
  • It saves e2e test time

How this works

  • Create network-dir flag to passing in the network directory storing network info
  • Save the teleporter registry addresses and validator addresses when creating a new network in the tests
  • When the network-dir flag is set, it loads the network from the directory and set the saved teleporter registry addresses and validator addresses

How this was tested

  • e2e tests

How is this documented

@ylg-avalabs ylg-avalabs marked this pull request as ready for review July 14, 2025 13:46
@ylg-avalabs ylg-avalabs requested a review from a team as a code owner July 14, 2025 13:46
log.Info("Waiting for 10s to ensure no new block confirmations on destination chain")
Consistently(newHeadsB, 10*time.Second, 500*time.Millisecond).ShouldNot(Receive())
// log.Info("Waiting for 10s to ensure no new block confirmations on destination chain")
// Consistently(newHeadsB, 10*time.Second, 500*time.Millisecond).ShouldNot(Receive())
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Why do we need this check? With reusing network, it failed to pass this check.

Copy link
Contributor

Choose a reason for hiding this comment

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

Does this still fail?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, it still failed. Can we remove this check?

@geoff-vball
Copy link
Contributor

I tried running this but couldn't get it to work. Where is the default location for network-dir that the network is saved to? I was getting an error saying "config.json" does not exist.

I would have expected to be able to set network-dir to a specific location and then:

  • If a network exists there, it reuses it.
  • If a network doesn't exist there, it creates a new one from scratch and saves it there.

@ylg-avalabs
Copy link
Contributor Author

I tried running this but couldn't get it to work. Where is the default location for network-dir that the network is saved to? I was getting an error saying "config.json" does not exist.

I would have expected to be able to set network-dir to a specific location and then:

  • If a network exists there, it reuses it.
  • If a network doesn't exist there, it creates a new one from scratch and saves it there

When we run the test in normal case (./scripts/e2e_test.sh), we will see the following logs. In the log, we see the directory where the network is persisted. Then, in the next run, we can reuse this network:

/scripts/e2e_test.sh --network-dir /Users/linguan.yang/.tmpnet/networks/20250724-144425.01028-icm-off-chain-services-eZe-test
Screenshot 2025-07-24 at 2 45 04 PM

@iansuvak
Copy link
Contributor

I do like Geoff's suggestion of creating a network if not already present and then re-using it if it is

log.Info("Waiting for 10s to ensure no new block confirmations on destination chain")
Consistently(newHeadsB, 10*time.Second, 500*time.Millisecond).ShouldNot(Receive())
// log.Info("Waiting for 10s to ensure no new block confirmations on destination chain")
// Consistently(newHeadsB, 10*time.Second, 500*time.Millisecond).ShouldNot(Receive())
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this still fail?

@ylg-avalabs ylg-avalabs requested a review from geoff-vball July 31, 2025 19:26
Copy link
Contributor

@geoff-vball geoff-vball left a comment

Choose a reason for hiding this comment

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

I ran this using ./scripts/e2e_test.sh --network-dir ~/reuse-dir twice. The first time passed. The second time failed failed to read network: failed to read network config: open /Users/geoffrey.stuart/reuse-dir/config.json: no such file or directory

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 e2e tests, why do we create a subnet and then convert it to an L-1

Copy link
Contributor

Choose a reason for hiding this comment

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

To test the L1 case. In general networks first get created as subnets and the concept of subnet still remains, i.e. they are still referred to by their subnetID even if they are L1s

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants