diff options
author | sundb <sundbcn@gmail.com> | 2022-03-18 20:10:24 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-18 14:10:24 +0200 |
commit | b9656adbd9c6a670e5c89b19c7721057c7d89c24 (patch) | |
tree | 85d2d66866f35b631aaa1b943ba37214c6b6f368 | |
parent | b69636d377cce0eb8c1fae3ac80240387e31d78f (diff) | |
download | redis-b9656adbd9c6a670e5c89b19c7721057c7d89c24.tar.gz |
Restore ::singledb after cluster test (#10441)
When ::singledb is 0, we will use db 9 for the test db.
Since ::singledb is set to 1 in the cluster-related tests, but not restored, some subsequent
tests associated with db 9 will fail.
-rw-r--r-- | tests/unit/cluster.tcl | 3 | ||||
-rw-r--r-- | tests/unit/moduleapi/cluster.tcl | 5 |
2 files changed, 7 insertions, 1 deletions
diff --git a/tests/unit/cluster.tcl b/tests/unit/cluster.tcl index 532b062ef..fb1f80ae4 100644 --- a/tests/unit/cluster.tcl +++ b/tests/unit/cluster.tcl @@ -19,6 +19,7 @@ proc csi {args} { } # make sure the test infra won't use SELECT +set old_singledb $::singledb set ::singledb 1 # cluster creation is complicated with TLS, and the current tests don't really need that coverage @@ -285,3 +286,5 @@ test {Migrate the last slot away from a node using redis-cli} { } } ;# tags + +set ::singledb $old_singledb diff --git a/tests/unit/moduleapi/cluster.tcl b/tests/unit/moduleapi/cluster.tcl index b2d2df899..3bd4977fd 100644 --- a/tests/unit/moduleapi/cluster.tcl +++ b/tests/unit/moduleapi/cluster.tcl @@ -22,6 +22,7 @@ set testmodule [file normalize tests/modules/blockonkeys.so] set testmodule_nokey [file normalize tests/modules/blockonbackground.so] # make sure the test infra won't use SELECT +set old_singledb $::singledb set ::singledb 1 # cluster creation is complicated with TLS, and the current tests don't really need that coverage @@ -202,4 +203,6 @@ start_server [list overrides $base_conf] { } } -} ;# tags
\ No newline at end of file +} ;# tags + +set ::singledb $old_singledb |