Merge pull request #6926 from oranagra/fork-test-fix

fix race in module api test for fork
This commit is contained in:
Salvatore Sanfilippo 2020-02-27 09:58:04 +01:00 committed by GitHub
commit d2c5f80e2e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 3 deletions

View File

@ -42,7 +42,7 @@ int fork_create(RedisModuleCtx *ctx, RedisModuleString **argv, int argc)
/* child */
RedisModule_Log(ctx, "notice", "fork child started");
usleep(200000);
usleep(500000);
RedisModule_Log(ctx, "notice", "fork child exiting");
RedisModule_ExitFromChild(code_to_exit_with);
/* unreachable */

View File

@ -20,9 +20,8 @@ start_server {tags {"modules"}} {
test {Module fork kill} {
r fork.create 3
after 20
after 250
r fork.kill
after 100
assert {[count_log_message "fork child started"] eq "2"}
assert {[count_log_message "Received SIGUSR1 in child"] eq "1"}