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

Improve runtime of tests #1854

Merged
merged 32 commits into from
Aug 14, 2024
Merged

Improve runtime of tests #1854

merged 32 commits into from
Aug 14, 2024

Conversation

tbro
Copy link
Contributor

@tbro tbro commented Aug 13, 2024

Closes #1848

This PR improves CI runtime by working around slow tests. The last commit on main, tests took 36min. Tests are currently completing in this PR in 12m.

  • switch to nextest
  • separate build and test steps
  • use --retries (retries and marks tests that succeed upon retry as FLAKY
  • split slow dev-node tests to separate workflow, only run that workflow on push to 'main'

Note that slow tests would now only be run on main, but the only tests currently considerd slow are dev-node tests. If this is merged more or less as is, I will create an issue to look into why these tests are slow and explore possible solutions.

@tbro tbro force-pushed the tb/next-test-or-not branch from 86739ba to ed19b80 Compare August 14, 2024 10:50
@tbro tbro force-pushed the tb/next-test-or-not branch from ed19b80 to c1cd5f5 Compare August 14, 2024 10:50
@tbro tbro marked this pull request as ready for review August 14, 2024 10:51
@tbro tbro changed the title Tb/next test or not Improve runtime of tests Aug 14, 2024
We think this will not be required on PR since it is a new workflow.
run: |
export RUSTFLAGS="$RUSTFLAGS --cfg hotshot_example"
export PATH="$PWD/target/release:$PATH"
cargo nextest run --locked --release --workspace --all-features --retries 2 --verbose -E '!test(slow_)'
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think it would be nice to add just recipies to mirror the new test commands locally since it's also nice to run the tests quickly locally. And sometimes we want to re-run the same tests as in a CI job locally.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Collaborator

@sveitser sveitser left a comment

Choose a reason for hiding this comment

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

LGTM, some suggestions

@@ -0,0 +1,64 @@
name: SlowEst
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
name: SlowEst
name: Slow Tests

RUST_LOG: info,libp2p=off,node=error

jobs:
slowest:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Or is "slowest" chosen on purpose?

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. I was it was a play on nextest plus these are in fact the slowest tests.

@tbro tbro merged commit 06bf72f into main Aug 14, 2024
14 checks passed
@tbro tbro deleted the tb/next-test-or-not branch August 14, 2024 11:59
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.

Reduce CI runtime
2 participants