From: Yannick Brosseau Date: Mon, 21 Feb 2011 19:36:09 +0000 (+0100) Subject: TESTS: Add a delay at the start of the fork test for a more uniform testing. X-Git-Tag: v0.12~32 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=36c95a5e121f351f8733fedeeb2669cb4b8aef17;p=ust.git TESTS: Add a delay at the start of the fork test for a more uniform testing. Add a sleep to leave time for the ustconsumer thread to initialize correctly before the fork. Most of the time the consumer was not yet started at the time of the fork so a bunch of initializations were not done and the fork code path was not tested properly. Signed-off-by: Yannick Brosseau Acked-by: Nils Carlson --- diff --git a/tests/fork/fork.c b/tests/fork/fork.c index 5ce3d6d..a80518d 100644 --- a/tests/fork/fork.c +++ b/tests/fork/fork.c @@ -34,6 +34,9 @@ int main(int argc, char **argv, char *env[]) printf("Fork test program, parent pid is %d\n", getpid()); trace_mark(ust, before_fork, MARK_NOARGS); + /* Sleep here to make sure the consumer is initialized before we fork */ + sleep(1); + result = fork(); if(result == -1) { perror("fork");