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

Commit 37998e9

Browse files
committed
tests: update memcached memory configuration
Signed-off-by: Reto Achermann <[email protected]>
1 parent c4a21e5 commit 37998e9

File tree

2 files changed

+18
-8
lines changed

2 files changed

+18
-8
lines changed

kernel/tests/s11_rackscale_benchmarks.rs

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -840,6 +840,8 @@ fn rackscale_memcached_checkout() {
840840
#[test]
841841
#[cfg(not(feature = "baremetal"))]
842842
fn s11_rackscale_memcached_benchmark_sharded_linux() {
843+
use std::fs::remove_file;
844+
843845
let machine = Machine::determine();
844846
let out_dir_path = PathBuf::from(env!("CARGO_TARGET_TMPDIR")).join("sharded-memcached");
845847
let is_smoke = cfg!(feature = "smoke");
@@ -870,7 +872,7 @@ fn s11_rackscale_memcached_benchmark_sharded_linux() {
870872
}
871873
};
872874

873-
let timeout_ms = if is_smoke { 60_000 } else { 600_000 };
875+
let timeout_ms = if is_smoke { 60_000 } else { 900_000 };
874876

875877
fn run_benchmark_internal(config: &MemcachedShardedConfig, timeout_ms: u64) -> PtySession {
876878
Command::new("killall").args(&["memcached"]).status().ok();
@@ -893,7 +895,9 @@ fn s11_rackscale_memcached_benchmark_sharded_linux() {
893895
let con_info = if config.protocol == "tcp" {
894896
format!("tcp://localhost:{}", 11211 + id)
895897
} else {
896-
format!("unix://{}/memcached{}.sock", config.path.display(), id)
898+
let pathname = config.path.join(format!("memcached{id}.sock"));
899+
remove_file(pathname); // make sure the socket file is removed
900+
format!("unix://{}", pathname.display())
897901
};
898902

899903
let mut command = Command::new("bash");
@@ -994,8 +998,9 @@ fn s11_rackscale_memcached_benchmark_sharded_linux() {
994998

995999
config.num_threads = num_threads;
9961000

997-
let _ = Command::new("killall").args(&["memcached"]).status();
998-
let _ = Command::new("killall").args(&["memcached"]).status();
1001+
let _ = Command::new("killall")
1002+
.args(&["memcached", "-s", "SIGKILL"])
1003+
.status();
9991004
let mut pty = run_benchmark_internal(&config, timeout_ms);
10001005
let mut output = String::new();
10011006
let res =
@@ -1020,8 +1025,9 @@ fn s11_rackscale_memcached_benchmark_sharded_linux() {
10201025
println!("Memcached Sharded: {num_threads}x{num_nodes} with {protocol}");
10211026

10221027
// terminate the memcached instance
1023-
let _ = Command::new("killall").args(&["memcached"]).status();
1024-
let _ = Command::new("killall").args(&["memcached"]).status();
1028+
let _ = Command::new("killall")
1029+
.args(&["memcached", "-s", "SIGKILL"])
1030+
.status();
10251031

10261032
let mut memcached_ctrls = Vec::new();
10271033
for i in 0..num_nodes {
@@ -1085,12 +1091,16 @@ fn s11_rackscale_memcached_benchmark_sharded_linux() {
10851091
let _ = Command::new("killall").args(&["memcached"]).status();
10861092
}
10871093
};
1094+
1095+
let _ = pty.process.kill(rexpect::process::signal::Signal::SIGKILL);
10881096
}
10891097
}
10901098
}
10911099

10921100
// terminate the memcached instance
1093-
let _ = Command::new("killall").args(&["memcached"]).status();
1101+
let _ = Command::new("killall")
1102+
.args(&["memcached", "-s", "SIGKILL"])
1103+
.status();
10941104
}
10951105

10961106
#[test]

kernel/testutils/src/configs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Copyright © 2021 VMware, Inc. All Rights Reserved.
22
// SPDX-License-Identifier: Apache-2.0 OR MIT
33

4-
pub const MEMCACHED_MEM_SIZE_MB: usize = 8 * 1024;
4+
pub const MEMCACHED_MEM_SIZE_MB: usize = 4 * 1024;
55
pub const MEMCACHED_NUM_QUERIES: usize = 1_000_000;

0 commit comments

Comments
 (0)