summaryrefslogtreecommitdiff
path: root/tests/support
diff options
context:
space:
mode:
authorsundb <sundbcn@gmail.com>2022-01-05 19:49:01 +0800
committerGitHub <noreply@github.com>2022-01-05 13:49:01 +0200
commit4d3c4cfac70557a28a62266543951d46d0cae584 (patch)
treec896d855f1c4739f73652716cbdc82fa4f6175f7 /tests/support
parent9538088751bec5e53799c600167c24c878fb651f (diff)
downloadredis-4d3c4cfac70557a28a62266543951d46d0cae584.tar.gz
Show the elapsed time of single test and speed up some tests (#10058)
Following #10038. This PR introduces two changes. 1. Show the elapsed time of a single test in the test output, in order to have a more detailed understanding of the changes in test run time. 2. Speedup two tests related to `key-load-delay` configuration. other tests do not seem to be affected by #10003.
Diffstat (limited to 'tests/support')
-rw-r--r--tests/support/test.tcl4
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/support/test.tcl b/tests/support/test.tcl
index b35b29185..f3f7e132a 100644
--- a/tests/support/test.tcl
+++ b/tests/support/test.tcl
@@ -180,6 +180,7 @@ proc test {name code {okpattern undefined} {tags {}}} {
send_data_packet $::test_server_fd testing $name
+ set test_start_time [clock milliseconds]
if {[catch {set retval [uplevel 1 $code]} error]} {
set assertion [string match "assertion:*" $error]
if {$assertion || $::durable} {
@@ -207,7 +208,8 @@ proc test {name code {okpattern undefined} {tags {}}} {
} else {
if {$okpattern eq "undefined" || $okpattern eq $retval || [string match $okpattern $retval]} {
incr ::num_passed
- send_data_packet $::test_server_fd ok $name
+ set elapsed [expr {[clock milliseconds]-$test_start_time}]
+ send_data_packet $::test_server_fd ok $name $elapsed
} else {
set msg "Expected '$okpattern' to equal or match '$retval'"
lappend details $msg