Mirror of the lttng-dev mailing list
 help / color / mirror / Atom feed
From: yannick.brosseau@gmail.com (Yannick Brosseau)
Subject: [ltt-dev] [UST PATCH] TESTS: Add a delay at the start of the fork test for a more uniform testing.
Date: Mon, 21 Feb 2011 14:36:09 -0500	[thread overview]
Message-ID: <1298316969-17543-1-git-send-email-yannick.brosseau@gmail.com> (raw)

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 <yannick.brosseau at gmail.com>
---
 tests/fork/fork.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

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");
-- 
1.7.2.3





             reply	other threads:[~2011-02-21 19:36 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-21 19:36 Yannick Brosseau [this message]
2011-02-22  8:28 ` Nils Carlson
2011-02-22 14:51   ` Yannick Brosseau
2011-02-22 15:54     ` Nils Carlson
2011-02-22 16:08       ` Yannick Brosseau
2011-02-23 15:45         ` Mathieu Desnoyers
2011-02-23  8:36 ` Nils Carlson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1298316969-17543-1-git-send-email-yannick.brosseau@gmail.com \
    --to=yannick.brosseau@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox