Fix: Racy event validation in tests
This pattern is fundamentally racy:
$TESTAPP_BIN $NR_ITER $NR_USEC_WAIT >/dev/null 2>&1 &
[...]
while [ -n "$(pidof $TESTAPP_BIN)" ]; do
sleep 1
done
pass "Wait for application end"
[...]
tracing_teardown
validate_trace $EXACT_EVENT_COUNT
It is possible that the check for "pidof $TESTAPP_BIN" occurs _before_
the execve() of the applications (starting the applications in background
with & is basically a clone() + execve()). The consequence is that the check
succeed, never waiting for any applications to finish and then the tracing
sessions are prematurely teared down. Thus the resulting trace contains only
some events. We then validate for a fixed number of events and thus the test
fails caused by this racy scheduling situation.
The fix is to start the applications in foreground instead of background.
Signed-off-by: Christian Babeux <christian.babeux@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
This page took 0.026177 seconds and 4 git commands to generate.