From: Francis Deslauriers Date: Wed, 8 Sep 2021 14:16:23 +0000 (-0400) Subject: Fix: Tests: race condition in test_ns_contexts_change X-Git-Tag: v2.12.6~14 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=f99d029f8a43359a3cc31fc129cc6e3eb90afc2b;p=lttng-tools.git Fix: Tests: race condition in test_ns_contexts_change 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 Signed-off-by: Jérémie Galarneau Change-Id: I29d9b41d2a2ed60a6c42020509c2067442ae332c --- diff --git a/tests/regression/ust/namespaces/test_ns_contexts_change b/tests/regression/ust/namespaces/test_ns_contexts_change index fb1e936cd..5d59ab7cb 100755 --- a/tests/regression/ust/namespaces/test_ns_contexts_change +++ b/tests/regression/ust/namespaces/test_ns_contexts_change @@ -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"