Skip to content

Commit

Permalink
correctly set timeout in rackscale runner
Browse files Browse the repository at this point in the history
Signed-off-by: Reto Achermann <[email protected]>
  • Loading branch information
achreto committed Nov 28, 2023
1 parent 82c757d commit bf776d4
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion kernel/tests/s11_rackscale_benchmarks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,7 @@ fn rackscale_memcached_internal_benchmark(transport: RackscaleTransport) {
if cfg!(feature = "smoke") {
60_000 as u64
} else {
(MEMCACHED_MEM_SIZE_MB / 10 * 1000 + MEMCACHED_NUM_QUERIES) as u64
((MEMCACHED_MEM_SIZE_MB / 10 + MEMCACHED_NUM_QUERIES) * 1000) as u64
}
}

Expand Down
4 changes: 2 additions & 2 deletions kernel/testutils/src/memcached.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@ pub struct MemcachedResult {
pub fn parse_memcached_output(p: &mut PtySession, output: &mut String) -> Result<MemcachedResult> {
// x_benchmark_mem = 10 MB
let (prev, matched) = p.exp_regex(r#"x_benchmark_mem = (\d+) MB"#)?;
// println!("> {}", matched);
println!("> {}", matched);
let b_mem = matched.replace("x_benchmark_mem = ", "").replace(" MB", "");

*output += prev.as_str();
*output += matched.as_str();

// number of threads: 3
let (prev, matched) = p.exp_regex(r#"number of threads: (\d+)"#)?;
// println!("> {}", matched);
println!("> {}", matched);
let b_threads = matched.replace("number of threads: ", "");

*output += prev.as_str();
Expand Down
9 changes: 6 additions & 3 deletions kernel/testutils/src/rackscale_runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -872,9 +872,6 @@ impl<T: Clone + Send + 'static> RackscaleBench<T> {
test_run.cores_per_client = cores_per_client;
test_run.num_clients = num_clients;

// Set controller timeout for this test
test_run.controller_timeout = test_run.client_timeout;

// Calculate command based on the number of cores
test_run.cmd = (self.cmd_fn)(total_cores, num_clients, test_run.arg.clone());

Expand All @@ -885,11 +882,17 @@ impl<T: Clone + Send + 'static> RackscaleBench<T> {
test_run.memory = (self.mem_fn)(total_cores, cores_per_client, is_smoke)
+ test_run.shmem_size * test_run.num_clients;

// Set controller timeout for this test
test_run.controller_timeout = test_run.client_timeout;

test_run.run_baseline();
} else {
test_run.client_timeout = (self.rackscale_timeout_fn)(total_cores);
test_run.memory = (self.mem_fn)(total_cores, cores_per_client, is_smoke) / test_run.num_clients;

// Set controller timeout for this test
test_run.controller_timeout = test_run.client_timeout;

test_run.run_rackscale();
}

Expand Down
1 change: 1 addition & 0 deletions kernel/testutils/src/runner_args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -641,6 +641,7 @@ pub fn wait_for_sigterm_or_successful_exit_no_log(
use rexpect::errors::ErrorKind::Timeout;
match e {
Error(Timeout(expected, got, _timeout), _st) => {
println!("Timeout");
println!("Expected: `{expected}`\n");
println!("Got:",);
let count = got.lines().count();
Expand Down

0 comments on commit bf776d4

Please sign in to comment.