Skip to content

Speedup tests#153

Open
schneems wants to merge 2 commits into
mainfrom
schneems/faster-test
Open

Speedup tests#153
schneems wants to merge 2 commits into
mainfrom
schneems/faster-test

Conversation

@schneems

Copy link
Copy Markdown
Contributor

Before:

$ cargo build && time cargo test 
cargo test  4.95s user 3.16s system 45% cpu 17.640 total

After:

$ cargo build && time cargo test 
cargo test 0.58s user 0.36s system 75% cpu 1.243 total

schneems added 2 commits June 23, 2026 17:38
The inventory_check doctest executed a real ~tens-of-MB tarball download
from S3 and checksummed it, costing ~3s per `cargo test` run and adding
network flakiness. Marking the fence `no_run` keeps the example
compile-checked (so it can't rot) without running the download. Real
artifact verification still happens via the inventory_check binary in CI.

Drops `Doc-tests shared` from ~3.03s to ~0.01s.
`with_retries` sleeps `RETRY_DELAY` (1s) between attempts, so any test
exercising a failing request (e.g. `test_download_tar_404`) paid ~2s of
pure wall-clock sleep. Compile `RETRY_DELAY` to 0ms under `cfg(test)` so
the retry logic is still fully exercised without the delay. Production
builds keep the 1s delay.
@schneems schneems marked this pull request as ready for review June 23, 2026 23:04
@schneems schneems requested a review from a team as a code owner June 23, 2026 23:04
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.

1 participant