Skip to content
This repository was archived by the owner on Jul 17, 2025. It is now read-only.

Commit d775ff6

Browse files
committed
Update memcache-bench git hash, detect memory allocation failures in memcached output, clean up compilation warnings
1 parent 25bc162 commit d775ff6

File tree

3 files changed

+25
-17
lines changed

3 files changed

+25
-17
lines changed

kernel/tests/s11_rackscale_benchmarks.rs

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -758,13 +758,18 @@ fn parse_memcached_output(
758758
*output += prev.as_str();
759759
*output += matched.as_str();
760760

761-
Ok(MemcachedShardedResult {
762-
b_threads,
763-
b_mem,
764-
b_queries,
765-
b_time,
766-
b_thpt,
767-
})
761+
if output.contains("MEMORY ALLOCATION FAILURE") {
762+
println!("Detected memory allocation error in memcached output");
763+
Err("Memory allocation failure".into())
764+
} else {
765+
Ok(MemcachedShardedResult {
766+
b_threads,
767+
b_mem,
768+
b_queries,
769+
b_time,
770+
b_thpt,
771+
})
772+
}
768773
}
769774

770775
#[cfg(not(feature = "baremetal"))]
@@ -804,12 +809,12 @@ fn rackscale_memcached_checkout() {
804809
}
805810

806811
println!(
807-
"CHECKOUT 0d90d53b99c3890b6e47efe08446e5180711ff09 {:?}",
812+
"CHECKOUT e585c23e578d79b18d703b06f26b6e10a502d129 {:?}",
808813
out_dir
809814
);
810815

811816
let res = Command::new("git")
812-
.args(&["checkout", "0d90d53b99c3890b6e47efe08446e5180711ff09"])
817+
.args(&["checkout", "e585c23e578d79b18d703b06f26b6e10a502d129"])
813818
.current_dir(out_dir_path.as_path())
814819
.output()
815820
.expect("git checkout failed");
@@ -902,7 +907,9 @@ fn s11_rackscale_memcached_benchmark_sharded_linux() {
902907
format!("tcp://localhost:{}", 11212 + id)
903908
} else {
904909
let pathname = config.path.join(format!("memcached{id}.sock"));
905-
remove_file(pathname.clone()); // make sure the socket file is removed
910+
if pathname.is_file() {
911+
remove_file(pathname.clone()).expect("Failed to remove path"); // make sure the socket file is removed
912+
}
906913
format!("unix://{}", pathname.display())
907914
};
908915

@@ -1020,7 +1027,7 @@ fn s11_rackscale_memcached_benchmark_sharded_linux() {
10201027
let r = csv_file.write(out.as_bytes());
10211028
assert!(r.is_ok());
10221029

1023-
let r = pty.process.kill(SIGKILL);
1030+
let _r = pty.process.kill(SIGKILL);
10241031

10251032
// single node
10261033
for protocol in &["tcp", "unix"] {
@@ -1073,11 +1080,11 @@ fn s11_rackscale_memcached_benchmark_sharded_linux() {
10731080
println!("Timeout while waiting for {} ms\n", timeout.as_millis());
10741081
println!("Expected: `{expected}`\n");
10751082
println!("Got:",);
1076-
for l in got.lines().take(5) {
1083+
for l in got.lines().take(20) {
10771084
println!(" > {l}");
10781085
}
10791086
} else {
1080-
println!("error: {}", e);
1087+
panic!("error: {}", e);
10811088
}
10821089

10831090
let r = csv_file.write(format!("{},", env!("GIT_HASH")).as_bytes());
@@ -1379,7 +1386,9 @@ fn s11_rackscale_memcached_benchmark_sharded_nros() {
13791386
};
13801387
bench.run_bench(false, is_smoke);
13811388
for mut ping in pings.into_iter() {
1382-
ping.process.kill(SIGKILL);
1389+
if !ping.process.kill(SIGKILL).is_ok() {
1390+
println!("Failed to kill ping process");
1391+
}
13831392
}
13841393
}
13851394

kernel/testutils/src/rackscale_runner.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use std::sync::atomic::{AtomicUsize, Ordering};
22
use std::sync::mpsc::{Receiver, Sender, TryRecvError};
33
use std::sync::{mpsc::channel, Arc, Mutex};
4-
use std::thread::{self, sleep};
4+
use std::thread;
55
use std::time::Duration;
66

77
use rexpect::errors::*;

kernel/testutils/src/runner_args.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -638,10 +638,9 @@ pub fn wait_for_sigterm_or_successful_exit_no_log(
638638
Err(e) => {
639639
log_qemu_args(args);
640640
println!("Qemu testing failed: {} ", name);
641-
use rexpect::errors::Error;
642641
use rexpect::errors::ErrorKind::Timeout;
643642
match e {
644-
Error(Timeout(expected, got, timeout), st) => {
643+
Error(Timeout(expected, got, _timeout), _st) => {
645644
println!("Expected: `{expected}`\n");
646645
println!("Got:",);
647646
let count = got.lines().count();

0 commit comments

Comments
 (0)