Skip to content

Commit 5745f74

Browse files
fix: Forward duration flag to spawned server in blocking runner
The blocking benchmark runner always passed --msg-count (returning 0 in duration mode) to the spawned server process, never forwarding -d. This caused server/client config divergence in duration-based blocking benchmarks — the server would receive --msg-count 0 while the client ran for a specific duration. Now mirrors the async runner's logic: - If config.duration is set, pass -d <seconds> - Otherwise if config.msg_count is set, pass --msg-count <count> - Otherwise pass neither (server uses defaults) Fixes #121 AI-assisted-by: Claude Opus 4.6 Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent d586320 commit 5745f74

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

src/benchmark_blocking.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -439,10 +439,16 @@ impl BlockingBenchmarkRunner {
439439
cmd.arg("-m")
440440
.arg(self.mechanism.to_possible_value().unwrap().get_name());
441441

442-
// Add message size and count
442+
// Add message size
443443
cmd.arg("--message-size")
444444
.arg(self.config.message_size.to_string());
445-
cmd.arg("--msg-count").arg(self.get_msg_count().to_string());
445+
446+
// Forward duration or msg-count (duration takes precedence)
447+
if let Some(duration) = self.config.duration {
448+
cmd.arg("-d").arg(format!("{}s", duration.as_secs_f64()));
449+
} else if let Some(count) = self.config.msg_count {
450+
cmd.arg("--msg-count").arg(count.to_string());
451+
}
446452

447453
// Add transport-specific identifiers
448454
if !transport_config.socket_path.is_empty() {

0 commit comments

Comments
 (0)