"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "tests/unit/moduleapi/blockonbackground.tcl" between
redis-6.2-rc3.tar.gz and redis-6.2.0.tar.gz

About: redis is an advanced key-value store. It is often referred to as a data structure server since keys can contain strings, hashes, lists, sets and sorted sets.

blockonbackground.tcl  (redis-6.2-rc3):blockonbackground.tcl  (redis-6.2.0)
set testmodule [file normalize tests/modules/blockonbackground.so] set testmodule [file normalize tests/modules/blockonbackground.so]
source tests/support/util.tcl source tests/support/util.tcl
start_server {tags {"modules"}} { start_server {tags {"modules"}} {
r module load $testmodule r module load $testmodule
test { blocked clients time tracking - check blocked command that uses Redis Module_BlockedClientMeasureTimeStart() is tracking background time} { test { blocked clients time tracking - check blocked command that uses Redis Module_BlockedClientMeasureTimeStart() is tracking background time} {
r slowlog reset r slowlog reset
r config set slowlog-log-slower-than 200000 r config set slowlog-log-slower-than 200000
assert_equal [r slowlog len] 0 if {!$::no_latency} {
assert_equal [r slowlog len] 0
}
r block.debug 0 10000 r block.debug 0 10000
assert_equal [r slowlog len] 0 if {!$::no_latency} {
assert_equal [r slowlog len] 0
}
r config resetstat r config resetstat
r block.debug 200 10000 r block.debug 200 10000
assert_equal [r slowlog len] 1 if {!$::no_latency} {
assert_equal [r slowlog len] 1
}
set cmdstatline [cmdrstat block.debug r] set cmdstatline [cmdrstat block.debug r]
regexp "calls=1,usec=(.*?),usec_per_call=(.*?),rejected_calls=0,failed_c alls=0" $cmdstatline usec usec_per_call regexp "calls=1,usec=(.*?),usec_per_call=(.*?),rejected_calls=0,failed_c alls=0" $cmdstatline usec usec_per_call
assert {$usec >= 100000} assert {$usec >= 100000}
assert {$usec_per_call >= 100000} assert {$usec_per_call >= 100000}
} }
test { blocked clients time tracking - check blocked command that uses Redis Module_BlockedClientMeasureTimeStart() is tracking background time even in timeo ut } { test { blocked clients time tracking - check blocked command that uses Redis Module_BlockedClientMeasureTimeStart() is tracking background time even in timeo ut } {
r slowlog reset r slowlog reset
r config set slowlog-log-slower-than 200000 r config set slowlog-log-slower-than 200000
assert_equal [r slowlog len] 0 if {!$::no_latency} {
assert_equal [r slowlog len] 0
}
r block.debug 0 20000 r block.debug 0 20000
assert_equal [r slowlog len] 0 if {!$::no_latency} {
assert_equal [r slowlog len] 0
}
r config resetstat r config resetstat
r block.debug 20000 200 r block.debug 20000 500
assert_equal [r slowlog len] 1 if {!$::no_latency} {
assert_equal [r slowlog len] 1
}
set cmdstatline [cmdrstat block.debug r] set cmdstatline [cmdrstat block.debug r]
regexp "calls=1,usec=(.*?),usec_per_call=(.*?),rejected_calls=0,failed_c alls=0" $cmdstatline usec usec_per_call regexp "calls=1,usec=(.*?),usec_per_call=(.*?),rejected_calls=0,failed_c alls=0" $cmdstatline usec usec_per_call
assert {$usec >= 100000} assert {$usec >= 250000}
assert {$usec_per_call >= 100000} assert {$usec_per_call >= 250000}
} }
test { blocked clients time tracking - check blocked command with multiple c alls RedisModule_BlockedClientMeasureTimeStart() is tracking the total backgrou nd time } { test { blocked clients time tracking - check blocked command with multiple c alls RedisModule_BlockedClientMeasureTimeStart() is tracking the total backgrou nd time } {
r slowlog reset r slowlog reset
r config set slowlog-log-slower-than 200000 r config set slowlog-log-slower-than 200000
assert_equal [r slowlog len] 0 if {!$::no_latency} {
assert_equal [r slowlog len] 0
}
r block.double_debug 0 r block.double_debug 0
assert_equal [r slowlog len] 0 if {!$::no_latency} {
assert_equal [r slowlog len] 0
}
r config resetstat r config resetstat
r block.double_debug 100 r block.double_debug 100
assert_equal [r slowlog len] 1 if {!$::no_latency} {
assert_equal [r slowlog len] 1
}
set cmdstatline [cmdrstat block.double_debug r] set cmdstatline [cmdrstat block.double_debug r]
regexp "calls=1,usec=(.*?),usec_per_call=(.*?),rejected_calls=0,failed_c alls=0" $cmdstatline usec usec_per_call regexp "calls=1,usec=(.*?),usec_per_call=(.*?),rejected_calls=0,failed_c alls=0" $cmdstatline usec usec_per_call
assert {$usec >= 60000} assert {$usec >= 60000}
assert {$usec_per_call >= 60000} assert {$usec_per_call >= 60000}
} }
test { blocked clients time tracking - check blocked command without calling RedisModule_BlockedClientMeasureTimeStart() is not reporting background time } { test { blocked clients time tracking - check blocked command without calling RedisModule_BlockedClientMeasureTimeStart() is not reporting background time } {
r slowlog reset r slowlog reset
r config set slowlog-log-slower-than 200000 r config set slowlog-log-slower-than 200000
assert_equal [r slowlog len] 0 if {!$::no_latency} {
assert_equal [r slowlog len] 0
}
r block.debug_no_track 200 1000 r block.debug_no_track 200 1000
# ensure slowlog is still empty # ensure slowlog is still empty
assert_equal [r slowlog len] 0 if {!$::no_latency} {
assert_equal [r slowlog len] 0
}
} }
} }
 End of changes. 12 change blocks. 
15 lines changed or deleted 36 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)