From 0621a2676ce0a1a32f97121faaf8e3b583cabf7f Mon Sep 17 00:00:00 2001 From: Binbin Date: Thu, 22 Aug 2024 14:56:32 +0800 Subject: [PATCH] Make runtest-cluster support --io-threads option In #764, we add a --io-threads mode in test, but forgot to handle runtest-cluster, they are different framework. Currently runtest-cluster does not support tags, and we don't have plan to support it. And currently cluster tests does not have any io-threads tests, so this PR just align --io-threads option with #764. Signed-off-by: Binbin --- tests/instances.tcl | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/instances.tcl b/tests/instances.tcl index 661281c995..5cc96b0edb 100644 --- a/tests/instances.tcl +++ b/tests/instances.tcl @@ -20,6 +20,7 @@ set ::verbose 0 set ::valgrind 0 set ::tls 0 set ::tls_module 0 +set ::io_threads 0 set ::pause_on_error 0 set ::dont_clean 0 set ::simulate_error 0 @@ -107,6 +108,11 @@ proc spawn_instance {type base_port count {conf {}} {base_conf_file ""}} { puts $cfg "port $port" } + if {$::io_threads} { + puts $cfg "io-threads 2" + puts $cfg "events-per-io-thread 0" + } + if {$::log_req_res} { puts $cfg "req-res-logfile stdout.reqres" } @@ -297,6 +303,8 @@ proc parse_options {} { if {$opt eq {--tls-module}} { set ::tls_module 1 } + } elseif {$opt eq {--io-threads}} { + set ::io_threads 1 } elseif {$opt eq {--config}} { set val2 [lindex $::argv [expr $j+2]] dict set ::global_config $val $val2 @@ -319,6 +327,7 @@ proc parse_options {} { puts "--valgrind Run with valgrind." puts "--tls Run tests in TLS mode." puts "--tls-module Run tests in TLS mode with Valkey module." + puts "--io-threads Run tests with IO threads." puts "--host Use hostname instead of 127.0.0.1." puts "--config Extra config argument(s)." puts "--fast-fail Exit immediately once the first test fails."