Fix: Tests: race condition in test_ns_contexts_change
authorFrancis Deslauriers <francis.deslauriers@efficios.com>
Wed, 8 Sep 2021 14:16:23 +0000 (10:16 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 8 Sep 2021 19:37:33 +0000 (15:37 -0400)
Issue
=====
The test script doesn't wait for the test application to complete before
stopping the tracing session. The race is that depending on the
scheduling the application is not always done generating events when the
session is stopped.

Fix
===
Make the test script wait for the termination of the test app before
stopping the session.

Signed-off-by: Francis Deslauriers <francis.deslauriers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: I29d9b41d2a2ed60a6c42020509c2067442ae332c

tests/regression/ust/namespaces/test_ns_contexts_change

index c0af15e95da10c34c05ed368397ca912d210a326..8a4b62ce3a4ff2a04542ae062ee2686b325ce632 100755 (executable)
@@ -79,6 +79,9 @@ function test_ns()
 
        touch "$file_sync_before_last"
 
+       # Wait for the test app to generate all expected events and exit.
+       wait $app_pid
+
        # stop and destroy
        stop_lttng_tracing_ok "$session_name"
        destroy_lttng_session_ok "$session_name"
This page took 0.0249 seconds and 4 git commands to generate.