summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorguybe7 <guy.benoish@redislabs.com>2022-12-20 13:21:50 +0530
committerGitHub <noreply@github.com>2022-12-20 09:51:50 +0200
commit9c7c6924a019b902996fc4b608541f475daa649d (patch)
treedbf8d847864a1a363e5e9cbb984fad82b4c491d3 /tests
parent669688a342d5c1697c737b23f456e1750b46f0ff (diff)
downloadredis-9c7c6924a019b902996fc4b608541f475daa649d.tar.gz
Cleanup: Get rid of server.core_propagates (#11572)
1. Get rid of server.core_propagates - we can just rely on module/call nesting levels 2. Rename in_nested_call to execution_nesting and update the comment 3. Remove module_ctx_nesting (redundant, we can use execution_nesting) 4. Modify postExecutionUnitOperations according to the comment (The main purpose of this PR) 5. trackingHandlePendingKeyInvalidations: Check the nesting level inside this function
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/moduleapi/cluster.tcl2
-rw-r--r--tests/unit/moduleapi/propagate.tcl29
2 files changed, 28 insertions, 3 deletions
diff --git a/tests/unit/moduleapi/cluster.tcl b/tests/unit/moduleapi/cluster.tcl
index 8851b0301..43356f77d 100644
--- a/tests/unit/moduleapi/cluster.tcl
+++ b/tests/unit/moduleapi/cluster.tcl
@@ -219,4 +219,4 @@ start_cluster 3 0 [list config_lines $modules] {
assert_equal {PONG} [$node2 PING]
assert_equal {PONG} [$node3 PING]
}
-} \ No newline at end of file
+}
diff --git a/tests/unit/moduleapi/propagate.tcl b/tests/unit/moduleapi/propagate.tcl
index 7bdc000ee..ce4aaae44 100644
--- a/tests/unit/moduleapi/propagate.tcl
+++ b/tests/unit/moduleapi/propagate.tcl
@@ -675,8 +675,10 @@ tags "modules" {
}
}
+
tags "modules aof" {
- test {Modules RM_Replicate replicates MULTI/EXEC correctly} {
+ foreach aofload_type {debug_cmd startup} {
+ test "Modules RM_Replicate replicates MULTI/EXEC correctly: AOF-load type $aofload_type" {
start_server [list overrides [list loadmodule "$testmodule"]] {
# Enable the AOF
r config set appendonly yes
@@ -690,11 +692,34 @@ tags "modules aof" {
r propagate-test.mixed
r exec
+ assert_equal [r get counter-1] {}
+ assert_equal [r get counter-2] {}
+ assert_equal [r get using-call] 2
+ assert_equal [r get after-call] 2
+ assert_equal [r get notifications] 4
+
# Load the AOF
- r debug loadaof
+ if {$aofload_type == "debug_cmd"} {
+ r debug loadaof
+ } else {
+ r config rewrite
+ restart_server 0 true false
+ wait_done_loading r
+ }
+
+ # This module behaves bad on purpose, it only calls
+ # RM_Replicate for counter-1 and counter-2 so values
+ # after AOF-load are different
+ assert_equal [r get counter-1] 4
+ assert_equal [r get counter-2] 4
+ assert_equal [r get using-call] 2
+ assert_equal [r get after-call] 2
+ # 4+4+2+2 commands from AOF (just above) + 4 "INCR notifications" from AOF + 4 notifications for these INCRs
+ assert_equal [r get notifications] 20
assert_equal {OK} [r module unload propagate-test]
assert_equal [s 0 unexpected_error_replies] 0
}
}
+ }
}