Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Racy event validation in tests #1

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 2 additions & 11 deletions tests/regression/tools/exclusion/test_exclusion
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ TESTAPP_NAME="gen-ust-nevents"
TESTAPP_BIN="$TESTAPP_PATH/$TESTAPP_NAME/$TESTAPP_NAME"
NR_ITER=100
NR_USEC_WAIT=1
NUM_TESTS=9
NUM_TESTS=8

source $TESTDIR/utils/utils.sh

Expand All @@ -44,15 +44,7 @@ function enable_ust_lttng_all_event_exclusion()

function run_apps
{
$TESTAPP_BIN $NR_ITER $NR_USEC_WAIT >/dev/null 2>&1 &
}

function wait_apps
{
while [ -n "$(pidof $BIN_NAME)" ]; do
sleep 1
done
pass "Wait for application end"
$TESTAPP_BIN $NR_ITER $NR_USEC_WAIT >/dev/null 2>&1
}

function test_exclusion
Expand All @@ -67,7 +59,6 @@ function test_exclusion
# Trace apps
start_lttng_tracing $SESSION_NAME
run_apps
wait_apps
stop_lttng_tracing $SESSION_NAME

# Destroy session
Expand Down
13 changes: 2 additions & 11 deletions tests/regression/tools/filtering/test_valid_filter
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ STATS_BIN="$TESTDIR/utils/babelstats.pl"
SESSION_NAME="valid_filter"
EVENT_NAME="tp:tptest"
NR_ITER=100
NUM_TESTS=338
NUM_TESTS=290

source $TESTDIR/utils/utils.sh

Expand All @@ -46,15 +46,7 @@ function enable_ust_lttng_event_filter()

function run_apps
{
./$CURDIR/$BIN_NAME $NR_ITER & >/dev/null 2>&1
}

function wait_apps
{
while [ -n "$(pidof $BIN_NAME)" ]; do
sleep 1
done
pass "Wait for application end"
./$CURDIR/$BIN_NAME $NR_ITER >/dev/null 2>&1
}

function test_valid_filter
Expand All @@ -75,7 +67,6 @@ function test_valid_filter
# Trace apps
start_lttng_tracing $SESSION_NAME
run_apps
wait_apps
stop_lttng_tracing $SESSION_NAME

# Destroy session
Expand Down
14 changes: 2 additions & 12 deletions tests/regression/tools/tracefile-limits/test_tracefile_count
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ TESTAPP_NAME="gen-ust-events"
TESTAPP_BIN="$TESTAPP_PATH/$TESTAPP_NAME/$TESTAPP_NAME"

STATS_BIN="$TESTDIR/utils/babelstats.pl"
NUM_TESTS=82
NUM_TESTS=74

NUM_CPUS=`nproc`

Expand All @@ -35,14 +35,6 @@ if [ ! -x "$TESTAPP_BIN" ]; then
BAIL_OUT "No UST events binary detected."
fi

function wait_apps
{
while [ -n "$(pidof $TESTAPP_NAME)" ]; do
sleep 0.5
done
pass "Wait for applications to end"
}

function enable_lttng_channel_count_limit ()
{
sess_name="$1"
Expand Down Expand Up @@ -126,9 +118,7 @@ function test_tracefile_count_limit ()

start_lttng_tracing $session_name

$TESTAPP_BIN $num_iter >/dev/null 2>&1 &

wait_apps
$TESTAPP_BIN $num_iter >/dev/null 2>&1

stop_lttng_tracing $session_name

Expand Down
14 changes: 2 additions & 12 deletions tests/regression/tools/tracefile-limits/test_tracefile_size
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,14 @@ TESTAPP_PATH="$TESTDIR/utils/testapp"
TESTAPP_NAME="gen-ust-events"
TESTAPP_BIN="$TESTAPP_PATH/$TESTAPP_NAME/$TESTAPP_NAME"

NUM_TESTS=47
NUM_TESTS=42

source $TESTDIR/utils/utils.sh

if [ ! -x "$TESTAPP_BIN" ]; then
BAIL_OUT "No UST events binary detected."
fi

function wait_apps
{
while [ -n "$(pidof $TESTAPP_NAME)" ]; do
sleep 0.5
done
pass "Wait for applications to end"
}

function enable_lttng_channel_size_limit ()
{
sess_name="$1"
Expand Down Expand Up @@ -118,9 +110,7 @@ function test_tracefile_size_limit ()

start_lttng_tracing $session_name

$TESTAPP_BIN $NR_ITER >/dev/null 2>&1 &

wait_apps
$TESTAPP_BIN $NR_ITER >/dev/null 2>&1

stop_lttng_tracing $session_name

Expand Down
3 changes: 1 addition & 2 deletions tests/regression/ust/buffers-pid/test_buffers_pid
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,9 @@ test_after_multiple_apps() {
start_lttng_tracing $SESSION_NAME

for i in `seq 1 5`; do
$TESTAPP_BIN $NR_ITER $NR_USEC_WAIT & >/dev/null 2>&1
$TESTAPP_BIN $NR_ITER $NR_USEC_WAIT >/dev/null 2>&1
ok $? "Start application $i for tracing"
done
wait_apps

stop_lttng_tracing $SESSION_NAME
destroy_lttng_session $SESSION_NAME
Expand Down