Mirror of the lttng-dev mailing list
 help / color / mirror / Atom feed
From: dgoulet@efficios.com (David Goulet)
Subject: [lttng-dev] [PATCH lttng-tools] Fix: mi test: possible race between listing UST events and testapp start
Date: Wed, 29 Oct 2014 14:23:43 -0400	[thread overview]
Message-ID: <20141029182343.GB8595@thessa> (raw)
In-Reply-To: <1414372906-22433-1-git-send-email-jonathan.r.julien@gmail.com>

On 26 Oct (21:21:46), Jonathan Rajotte wrote:
> Signed-off-by: Jonathan Rajotte <jonathan.r.julien at gmail.com>
> ---
>  tests/regression/tools/mi/test_mi | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/tests/regression/tools/mi/test_mi b/tests/regression/tools/mi/test_mi
> index fa46b51..7acec18 100755
> --- a/tests/regression/tools/mi/test_mi
> +++ b/tests/regression/tools/mi/test_mi
> @@ -507,6 +507,11 @@ function test_list_ust_event ()
>  
>  	#Begin testing
>  	$TESTAPP_BIN $NR_USEC_WAIT & 2>/dev/null
> +	pid=$!
> +
> +	#Wait for TESTAPP to run
> +	while ! kill -0 $pid 2> /dev/null; do :; done

So of what I understand here, this tests the existance of the PID but
wondering if it really fixes the race. Even if the PID indeed exists,
still it might not have registered to the session daemon.

I think one way to fix that is to have a "lttng list -u | grep $PID"
test and if the output is not empty, the application did registered.
Also, you can use the "create file" option of gen-ust-events. You can
pass a fourth argument to the app, once a tracepoint is hit, it will
create the file you gave with the full path. You can then loop on that.
There are some tests that already uses that, you can check it out.

Finally, that test should actually spawn the application with a long
life time and kill it at the end so we don't race between very long
commands and the application actually quiting gracefully.

Cheers!
David

> +
>  	list_lttng_with_opts "-u -f"
>  	$XML_VALIDATE $OUTPUT_DEST
>  	ok $? "Mi test: list ust event xsd validation"
> -- 
> 1.9.1
> 
> 
> _______________________________________________
> lttng-dev mailing list
> lttng-dev at lists.lttng.org
> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 603 bytes
Desc: Digital signature
URL: <http://lists.lttng.org/pipermail/lttng-dev/attachments/20141029/4a0d1c16/attachment.sig>


      parent reply	other threads:[~2014-10-29 18:23 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-27  1:21 Jonathan Rajotte
2014-10-27 20:48 ` Nathan Lynch
2014-10-27 22:50   ` Jonathan Rajotte
2014-10-29 18:23 ` David Goulet [this message]

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=20141029182343.GB8595@thessa \
    --to=dgoulet@efficios.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