Skip to content

Tests (cluster / sentinel): add --stop and--loop options#11070

Merged
oranagra merged 2 commits intoredis:unstablefrom
enjoy-binbin:loop_option
Aug 1, 2022
Merged

Tests (cluster / sentinel): add --stop and--loop options#11070
oranagra merged 2 commits intoredis:unstablefrom
enjoy-binbin:loop_option

Conversation

@enjoy-binbin
Copy link
Contributor

@enjoy-binbin enjoy-binbin commented Aug 1, 2022

--stop: Blocks once the first test fails.
--loop: Execute the specified set of tests forever.
It is useful when we debug some test failures.

Execute the specified set of tests forever.
It is useful when we debug some test failures.
@enjoy-binbin
Copy link
Contributor Author

enjoy-binbin commented Aug 1, 2022

with these options, now we can do something like:

[root@binblog redis]# ./runtest-cluster --single 29 --single 28 --stop --loop
Starting redis #0 at port 30020
...
Testing unit: 28-cluster-shards.tcl
...
15:04:46> Test the replica reports a loading state while it's loading: OK
15:04:49> Regression test for a crash when calling SHARDS during handshake: OK
Testing unit: 29-slot-migration-response.tcl
...
15:04:53> Create a 2 nodes cluster: OK
15:04:58> Cluster is up: OK
15:04:58> Set many keys in the cluster: FAILED: caught an error in the test key "13907" not known in dictionary
key "13907" not known in dictionary
    while executing
"dict get $::redis_cluster::slots($id) $slot"
    (procedure "::redis_cluster::__dispatch__" line 16)
    invoked from within
"$cluster set $i $i"
    ("uplevel" body line 3)
    invoked from within
"uplevel 1 $code"
    (procedure "test" line 6)
    invoked from within
"test "Set many keys in the cluster" {
    for {set i 0} {$i < 5000} {incr i} {
        $cluster set $i $i
        assert { [$cluster get $i] eq $i }
 ..."
    (file "../tests/29-slot-migration-response.tcl" line 21)
    invoked from within
"source $test "
(Test stopped, press enter to resume the tests)
Testing unit: 28-cluster-shards.tcl
....

@oranagra
Copy link
Member

oranagra commented Aug 1, 2022

the loop option was introduced together with --stop, i guess we may want it here too.
i.e. to stop earlier as soon as a failure was found.

@enjoy-binbin enjoy-binbin changed the title Tests (cluster / sentinel): add --loop option Tests (cluster / sentinel): add --stop and--loop options Aug 1, 2022
@oranagra oranagra merged commit e13b681 into redis:unstable Aug 1, 2022
@enjoy-binbin enjoy-binbin deleted the loop_option branch August 1, 2022 07:13
enjoy-binbin added a commit to enjoy-binbin/redis that referenced this pull request Jul 31, 2023
--stop: Blocks once the first test fails.
--loop: Execute the specified set of tests forever.
It is useful when we debug some test failures.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants