mirror of
https://codeberg.org/redict/redict.git
synced 2025-01-22 16:18:28 -05:00
fix race in module api test for fork
in some cases we were trying to kill the fork before it got created
This commit is contained in:
parent
e78c4e813c
commit
0a643efa0c
@ -42,7 +42,7 @@ int fork_create(RedisModuleCtx *ctx, RedisModuleString **argv, int argc)
|
|||||||
|
|
||||||
/* child */
|
/* child */
|
||||||
RedisModule_Log(ctx, "notice", "fork child started");
|
RedisModule_Log(ctx, "notice", "fork child started");
|
||||||
usleep(200000);
|
usleep(500000);
|
||||||
RedisModule_Log(ctx, "notice", "fork child exiting");
|
RedisModule_Log(ctx, "notice", "fork child exiting");
|
||||||
RedisModule_ExitFromChild(code_to_exit_with);
|
RedisModule_ExitFromChild(code_to_exit_with);
|
||||||
/* unreachable */
|
/* unreachable */
|
||||||
|
@ -20,9 +20,8 @@ start_server {tags {"modules"}} {
|
|||||||
|
|
||||||
test {Module fork kill} {
|
test {Module fork kill} {
|
||||||
r fork.create 3
|
r fork.create 3
|
||||||
after 20
|
after 250
|
||||||
r fork.kill
|
r fork.kill
|
||||||
after 100
|
|
||||||
|
|
||||||
assert {[count_log_message "fork child started"] eq "2"}
|
assert {[count_log_message "fork child started"] eq "2"}
|
||||||
assert {[count_log_message "Received SIGUSR1 in child"] eq "1"}
|
assert {[count_log_message "Received SIGUSR1 in child"] eq "1"}
|
||||||
|
Loading…
Reference in New Issue
Block a user