From 1167e36ead3d07bf6b68fb89ef992367e4eafbd1 Mon Sep 17 00:00:00 2001 From: Erik Hollensbe Date: Fri, 18 Feb 2022 07:59:40 -0800 Subject: [PATCH] make tasks to test at nproc / 2, which minimizes cpu thrashing closes #17 Signed-off-by: Erik Hollensbe --- Makefile | 9 +++++++-- README.md | 14 ++++++++++++++ 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 77c5dec..ed01203 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,12 @@ postgres: stop-postgres stop-postgres: docker rm -f acmed-postgres || : -run-with-backtrace: - RUST_BACKTRACE=1 rustup run nightly cargo run +CARGO_TEST=cargo test -- --test-threads $$(($$(nproc) / 2)) + +test: + ${CARGO_TEST} + +debug-test: + DEBUG=1 cargo test -- --nocapture --test-threads $$(($$(nproc) / 2)) .PHONY: postgres stop-postgres diff --git a/README.md b/README.md index e498229..00a725d 100644 --- a/README.md +++ b/README.md @@ -53,10 +53,24 @@ psql -U postgres -h localhost coyote `docker` is required to run the tests. The tests take around 70 seconds to run on a 5900X and use all 24 threads most of the test runtime. Be mindful of the time they take, especially when running them on a slower system. +If you like full throttle: + ``` cargo test ``` +Add `DEBUG=1` for verbose test logging. + +If you'd like tests that don't punish your processor, you can run: + +``` +make test +# or +make debug-test +``` + +To accomplish the same using roughly only half of the CPU time. + ## Task List ### JOSE/ACME Protocols: