diff --git a/.github/workflows/test-aarch64.yml b/.github/workflows/test-aarch64.yml index 3be1ca6d..50418eba 100644 --- a/.github/workflows/test-aarch64.yml +++ b/.github/workflows/test-aarch64.yml @@ -14,8 +14,6 @@ jobs: curl https://sh.rustup.rs -sSf | sh -s -- -y echo "$HOME/.cargo/bin" >> $GITHUB_PATH - name: Test - run: | - make test + run: make test - name: Stress test - run: | - make stress + run: make stress diff --git a/Cargo.lock b/Cargo.lock index 35e57665..366cd946 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1046,6 +1046,7 @@ dependencies = [ "env_logger", "libstress", "log", + "num_cpus", "rand", "skytable", "sysinfo", diff --git a/stress-test/Cargo.toml b/stress-test/Cargo.toml index c4abfffc..c0e5f654 100644 --- a/stress-test/Cargo.toml +++ b/stress-test/Cargo.toml @@ -17,3 +17,4 @@ env_logger = "0.8.4" log = "0.4.14" rand = "0.8.4" crossbeam-channel = "0.5.1" +num_cpus = "1.13.0" diff --git a/stress-test/src/main.rs b/stress-test/src/main.rs index ebbaa9d0..d646a731 100644 --- a/stress-test/src/main.rs +++ b/stress-test/src/main.rs @@ -56,12 +56,10 @@ fn main() { // get the rng and refresh sysinfo let mut rng = thread_rng(); // we only need to refresh memory and CPU info; don't waste time syncing other things - let to_refresh = RefreshKind::new().with_memory().with_cpu(); + let to_refresh = RefreshKind::new().with_memory(); let mut sys = System::new_with_specifics(to_refresh); sys.refresh_specifics(to_refresh); - let core_count = sys - .get_physical_core_count() - .exit_error("Failed to get physical core count"); + let core_count = num_cpus::get(); let max_workers = core_count * 2; trace!( "This host has {} logical cores. Will spawn a maximum of {} threads",