The test now SIGSTOP the application before validating the trace and
once done, SIGKILL them. This way we make sure we test the periodical
flush feature by letting the application live, stopping it from creating
more events and validating the flush.
Signed-off-by: David Goulet <dgoulet@efficios.com>
start_lttng_tracing $SESSION_NAME
# Start application after tracing
start_lttng_tracing $SESSION_NAME
# Start application after tracing
- $TESTAPP_BIN $NR_ITER $NR_USEC_WAIT
+ $TESTAPP_BIN $NR_ITER $NR_USEC_WAIT &
ok $? "Start application to trace"
# At least hit one event
ok $? "Start application to trace"
# At least hit one event
# Make sure the application does not generate any more data,
# thus ensuring that we are not flushing a packet concurrently
# with validate_trace.
# Make sure the application does not generate any more data,
# thus ensuring that we are not flushing a packet concurrently
# with validate_trace.
- killall -q $TESTAPP_NAME
+ killall -SIGSTOP -q $TESTAPP_NAME
+
+ # Give time to the consumer to write inflight data.
stop_lttng_tracing $SESSION_NAME
destroy_lttng_session $SESSION_NAME
stop_lttng_tracing $SESSION_NAME
destroy_lttng_session $SESSION_NAME
+ killall -SIGKILL -q $TESTAPP_NAME
+ wait_apps
+
# Make sure the application does not generate any more data,
# thus ensuring that we are not flushing a packet concurrently
# with validate_trace.
# Make sure the application does not generate any more data,
# thus ensuring that we are not flushing a packet concurrently
# with validate_trace.
- killall -q $TESTAPP_NAME
+ killall -SIGSTOP -q $TESTAPP_NAME
+
+ # Give time to the consumer to write inflight data.
stop_lttng_tracing $SESSION_NAME
destroy_lttng_session $SESSION_NAME
stop_lttng_tracing $SESSION_NAME
destroy_lttng_session $SESSION_NAME
+ killall -SIGKILL -q $TESTAPP_NAME
start_lttng_tracing $SESSION_NAME
# Start application after tracing
start_lttng_tracing $SESSION_NAME
# Start application after tracing
- $TESTAPP_BIN $NR_ITER $NR_USEC_WAIT
+ $TESTAPP_BIN $NR_ITER $NR_USEC_WAIT &
ok $? "Start application to trace"
# At least hit one event
ok $? "Start application to trace"
# At least hit one event
# Make sure the application does not generate any more data,
# thus ensuring that we are not flushing a packet concurrently
# with validate_trace.
# Make sure the application does not generate any more data,
# thus ensuring that we are not flushing a packet concurrently
# with validate_trace.
- killall -q $TESTAPP_NAME
+ killall -SIGSTOP -q $TESTAPP_NAME
+
+ # Give time to the consumer to write inflight data.
stop_lttng_tracing $SESSION_NAME
destroy_lttng_session $SESSION_NAME
stop_lttng_tracing $SESSION_NAME
destroy_lttng_session $SESSION_NAME
+ killall -SIGKILL -q $TESTAPP_NAME
+ wait_apps
+
diag "Start application BEFORE tracing is started"
diag "Start application BEFORE tracing is started"
- # Start application after tracing
+ # Start application before tracing
$TESTAPP_BIN $NR_ITER $NR_USEC_WAIT &
ok $? "Start application to trace"
$TESTAPP_BIN $NR_ITER $NR_USEC_WAIT &
ok $? "Start application to trace"
# Make sure the application does not generate any more data,
# thus ensuring that we are not flushing a packet concurrently
# with validate_trace.
# Make sure the application does not generate any more data,
# thus ensuring that we are not flushing a packet concurrently
# with validate_trace.
- killall -q $TESTAPP_NAME
+ killall -SIGSTOP -q $TESTAPP_NAME
+
+ # Give time to the consumer to write inflight data.
stop_lttng_tracing $SESSION_NAME
destroy_lttng_session $SESSION_NAME
stop_lttng_tracing $SESSION_NAME
destroy_lttng_session $SESSION_NAME
+ killall -SIGKILL -q $TESTAPP_NAME