Skip to content

Commit

Permalink
add solo test progress and update the all test count including solotest
Browse files Browse the repository at this point in the history
Signed-off-by: Shivshankar-Reddy <[email protected]>
  • Loading branch information
Shivshankar-Reddy committed Oct 3, 2024
1 parent 54ce5d2 commit 0b0843b
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions tests/test_helper.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ set ::ignoredigest 0
set ::large_memory 0
set ::log_req_res 0
set ::force_resp3 0
set ::solo_tests_flag 0
set ::solo_tests_count 0

# Set to 1 when we are running in client mode. The server test uses a
# server-client model to run tests simultaneously. The server instance
Expand Down Expand Up @@ -368,16 +368,11 @@ proc read_from_test_client fd {
signal_idle_client $fd
} elseif {$status eq {done}} {
set elapsed [expr {[clock seconds]-$::clients_start_time($fd)}]
set all_tests_count [llength $::all_tests]
set all_tests_count [expr {[llength $::all_tests]+$::solo_tests_count}]
set running_tests_count [expr {[llength $::active_clients]-1}]
set completed_tests_count [expr {$::next_test-$running_tests_count}]
# Solo tests are excluded from the completed_tests_count. Ref: #valkey/issues/1017
if {!$::solo_tests_flag} {
puts "\[$completed_tests_count/$all_tests_count [colorstr yellow $status]\]: $data ($elapsed seconds)"
} else {
puts "\[[colorstr yellow $status]\]: $data ($elapsed seconds)"
set ::solo_tests_flag 0
}
set completed_solo_tests_count [expr {$::solo_tests_count-[llength $::run_solo_tests]}]
set completed_tests_count [expr {$::next_test-$running_tests_count+$completed_solo_tests_count}]
puts "\[$completed_tests_count/$all_tests_count [colorstr yellow $status]\]: $data ($elapsed seconds)"
lappend ::clients_time_history $elapsed $data
signal_idle_client $fd
set ::active_clients_task($fd) "(DONE) $data"
Expand Down Expand Up @@ -428,6 +423,7 @@ proc read_from_test_client fd {
set ::active_clients_task($fd) "(KILLED SERVER) pid:$data"
} elseif {$status eq {run_solo}} {
lappend ::run_solo_tests $data
incr ::solo_tests_count
} else {
if {!$::quiet} {
puts "\[$status\]: $data"
Expand Down Expand Up @@ -495,7 +491,6 @@ proc signal_idle_client fd {
incr ::loop -1
}
} elseif {[llength $::run_solo_tests] != 0 && [llength $::active_clients] == 0} {
incr ::solo_tests_flag
if {!$::quiet} {
puts [colorstr bold-white "Testing solo test"]
set ::active_clients_task($fd) "ASSIGNED: $fd solo test"
Expand Down

0 comments on commit 0b0843b

Please sign in to comment.