Skip to content

Conversation

@marun
Copy link
Contributor

@marun marun commented May 27, 2023

Why this should be merged

#1547 (Kurtosis test migration) requires developing new e2e tests, and this change reduces the iteration time required to implement new tests.

How this works

  • remove sleep on network creation that was costing ~50s per test run even if only running a single test
  • remove use of snapshots to ensure a pristine network state for some tests
    • easier to just create a new network and avoid the cost (~7s) of taking the initial snapshot
  • only create a new network where required
    • if the network hasn't yet been modified, no point in creating a new one
  • support using a persistent network directly from the network runner instead of having to supply uris

How this was tested

# Started avalanche-network runner
/tmp/avalanche-network-runner server --log-level debug --port=":12342" --disable-grpc-gateway &

# Built the test binary
ginkgo build ./tests/e2e/

# Ran the e2e tests against test-managed networks
./tests/e2e/e2e.test --network-runner-avalanchego-path=$PWD/build/avalanchego --test-keys-file=$PWD/tests/test.insecure.secp256k1.keys --network-runner-grpc-endpoint=0.0.0.0:12342

# Started a network outside of testing
/tmp/avalanche-network-runner control start --avalanchego-path=$PWD/build/avalanchego --endpoint 0.0.0.0:12342

# Ran a test against a persistent network
./tests/e2e/e2e.test --network-runner-avalanchego-path=$PWD/build/avalanchego --test-keys-file=$PWD/tests/test.insecure.secp256k1.keys --network-runner-grpc-endpoint=0.0.0.0:12342 --use-persistent-network

Open questions

  • How to provide developers with a reproducible environment to run the e2es? The current ci script downloads ginkgo and avalanche-network-runner but it doesn't support executing single tests repeatedly.
  • Does the e2e Environment fixture need to be thread-safe so long as it is only possible to execute tests serially given their dependence on a shared test network (otherwise tests affecting one another becomes a real problem)?

 - remove sleep on network creation that was costing ~50s per test run
 - remove use of snapshots to ensure a pristine network state
   - easier to just create a new network and avoid the cost (~7s) of
     taking the initial snapshot
 - only create a new network where required
   - if the network hasn't yet been modified, no point in creating a
     new one
 - support using a persistent network directly from the network runner
   instead of having to supply urls
@marun marun requested review from abi87 and gyuho as code owners May 27, 2023 02:34
@marun marun changed the title WIP Reduce cost of e2e development Reduce cost of e2e development May 31, 2023
@marun marun changed the title Reduce cost of e2e development WIP Reduce cost of e2e development May 31, 2023
@marun marun marked this pull request as draft May 31, 2023 23:08
@marun marun changed the title WIP Reduce cost of e2e development Reduce cost of e2e development May 31, 2023
@github-actions
Copy link

github-actions bot commented Jul 2, 2023

This PR has become stale because it has been open for 30 days with no activity. Adding the lifecycle/frozen label will cause this PR to ignore lifecycle events.

@marun
Copy link
Contributor Author

marun commented Jul 6, 2023

Replaced by #1700

@marun marun closed this Jul 6, 2023
@marun marun deleted the faster-e2e-iteration branch April 2, 2024 12:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

No open projects
Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants