1
0
mirror of https://github.com/fluencelabs/redis synced 2025-07-03 02:41:33 +00:00
Files
.github
deps
src
tests
assets
cluster
helpers
integration
modules
sentinel
support
tmp
unit
moduleapi
blockonkeys.tcl
commandfilter.tcl
datatype.tcl
fork.tcl
hooks.tcl
infotest.tcl
misc.tcl
propagate.tcl
testrdb.tcl
type
acl.tcl
aofrw.tcl
auth.tcl
bitfield.tcl
bitops.tcl
dump.tcl
expire.tcl
geo.tcl
hyperloglog.tcl
introspection-2.tcl
introspection.tcl
keyspace.tcl
latency-monitor.tcl
lazyfree.tcl
limits.tcl
maxmemory.tcl
memefficiency.tcl
multi.tcl
obuf-limits.tcl
other.tcl
pendingquerybuf.tcl
printver.tcl
protocol.tcl
pubsub.tcl
quit.tcl
scan.tcl
scripting.tcl
slowlog.tcl
sort.tcl
tls.tcl
wait.tcl
instances.tcl
test_helper.tcl
utils
.gitignore
00-RELEASENOTES
BUGS
CONTRIBUTING
COPYING
INSTALL
MANIFESTO
Makefile
README.md
TLS.md
redis.conf
runtest
runtest-cluster
runtest-moduleapi
runtest-sentinel
sentinel.conf
redis/tests/unit/moduleapi/fork.tcl

33 lines
828 B
Tcl
Raw Normal View History

set testmodule [file normalize tests/modules/fork.so]
proc count_log_message {pattern} {
set result [exec grep -c $pattern < [srv 0 stdout]]
}
start_server {tags {"modules"}} {
r module load $testmodule
test {Module fork} {
# the argument to fork.create is the exitcode on termination
r fork.create 3
wait_for_condition 20 100 {
[r fork.exitcode] != -1
} else {
fail "fork didn't terminate"
}
r fork.exitcode
} {3}
test {Module fork kill} {
r fork.create 3
after 20
r fork.kill
after 100
assert {[count_log_message "fork child started"] eq "2"}
assert {[count_log_message "Received SIGUSR1 in child"] eq "1"}
assert {[count_log_message "fork child exiting"] eq "1"}
}
}