From 3cbaef8441ad5f35a5ed4eac75a4724d101298e4 Mon Sep 17 00:00:00 2001 From: Thomas Braun Date: Sat, 23 Nov 2024 16:12:03 -0500 Subject: [PATCH] refactor: update nextest config timeout policy, add mt tests to windows, skip some tests on windows --- .config/nextest.toml | 6 ++++-- .github/workflows/validate.yml | 6 +++++- citadel_sdk/tests/stress_tests.rs | 20 ++++++++++++++++++++ 3 files changed, 29 insertions(+), 3 deletions(-) diff --git a/.config/nextest.toml b/.config/nextest.toml index 2d2b2d93f..418f5463a 100644 --- a/.config/nextest.toml +++ b/.config/nextest.toml @@ -10,6 +10,8 @@ retries = { backoff = "exponential", count = 2, delay = "5s" } # the string "num-cpus". Can be overridden through the `--test-threads` option. test-threads = 1 +slow-timeout = { period = "80s", terminate-after = 3, grace-period = "0s" } + # Show these test statuses in the output. # # The possible values this can take are: @@ -25,10 +27,10 @@ test-threads = 1 # failed and retried tests. # # Can be overridden through the `--status-level` flag. -status-level = "pass" +status-level = "all" # Similar to status-level, show these test statuses at the end of the run. -final-status-level = "none" +final-status-level = "all" # "failure-output" defines when standard output and standard error for failing tests are produced. # Accepted values are diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 1c99bb5d9..22951e2a5 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -12,6 +12,7 @@ env: # 40 MiB stack RUST_MIN_STACK: 40971520 RUST_LOG: "citadel=warn" + IN_CI: "true" jobs: core_libs: @@ -100,8 +101,11 @@ jobs: - name: Single-threaded testing (windows only) run: cargo nextest run --package citadel_sdk --features=localhost-testing,vendored if: startsWith(matrix.os, 'windows') + - name: Multi-threaded testing (windows only) + run: cargo nextest run --package citadel_sdk --features=multi-threaded,localhost-testing,vendored + if: startsWith(matrix.os, 'windows') - name: Multi-threaded testing - if: startsWith(matrix.os, 'ubuntu') + if: ${{ !startsWith(matrix.os, 'windows') }} run: cargo nextest run --package citadel_sdk --features=multi-threaded,localhost-testing citadel_sdk_release: diff --git a/citadel_sdk/tests/stress_tests.rs b/citadel_sdk/tests/stress_tests.rs index e0ffae787..2334a695a 100644 --- a/citadel_sdk/tests/stress_tests.rs +++ b/citadel_sdk/tests/stress_tests.rs @@ -275,6 +275,16 @@ mod tests { #[values(EncryptionAlgorithm::Kyber)] enx: EncryptionAlgorithm, ) { citadel_logging::setup_log(); + + if cfg!(windows) + && kem == KemAlgorithm::Ntru + && secrecy_mode == SecrecyMode::Perfect + && std::env::var("IN_CI").is_ok() + { + log::warn!(target: "citadel", "Skipping NTRU/Perfect forward secrecy test on Windows due to performance issues"); + return; + } + citadel_sdk::test_common::TestBarrier::setup(2); static CLIENT_SUCCESS: AtomicBool = AtomicBool::new(false); static SERVER_SUCCESS: AtomicBool = AtomicBool::new(false); @@ -351,6 +361,16 @@ mod tests { enx: EncryptionAlgorithm, ) { citadel_logging::setup_log(); + + if cfg!(windows) + && kem == KemAlgorithm::Ntru + && secrecy_mode == SecrecyMode::Perfect + && std::env::var("IN_CI").is_ok() + { + log::warn!(target: "citadel", "Skipping NTRU/Perfect forward secrecy test on Windows due to performance issues"); + return; + } + citadel_sdk::test_common::TestBarrier::setup(2); let client0_success = &AtomicBool::new(false); let client1_success = &AtomicBool::new(false);