Skip to content

Commit

Permalink
Special case CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Jake-Shadle committed Feb 7, 2024
1 parent 16ac605 commit b969d1e
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions tests/connect/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,21 +48,24 @@ fn main() {
ts = mt;
}

// The connection count should be roughly the same as the processor count
let stdout = std::process::Command::new("nproc").output().unwrap().stdout;
let proc_count: usize = if std::env::var_os("CI").is_none() {
// The connection count should be roughly the same as the processor count
let stdout = std::process::Command::new("nproc").output().unwrap().stdout;

let proc_count: usize = std::str::from_utf8(&stdout)
.unwrap()
.trim()
.parse()
.unwrap();
std::str::from_utf8(&stdout)
.unwrap()
.trim()
.parse()
.unwrap()
} else {
30
};

let max = proc_count + (proc_count as f32 * 0.05).floor() as usize;

for test in ["reuses_connection", "async_reuses_connection"] {
assert!(
std::process::Command::new("strace")
.env("RAYON_NUM_THREADS", proc_count.to_string())
.args([
"-f",
"-e",
Expand Down

0 comments on commit b969d1e

Please sign in to comment.