tests: Use destroy with no-wait during filter tests
authorKienan Stewart <kstewart@efficios.com>
Wed, 6 Sep 2023 15:56:45 +0000 (11:56 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 21 Dec 2023 21:38:35 +0000 (16:38 -0500)
Motivation
==========

The regression/tool/sfiltering/test_valid_filter test is one of the
longest running tests in the test suite, largely due to the number of
filters tested.

The session destroy step for each test takes in the order of 500-600ms
on my development machine and accounts for an important sum of time
across a run as each filter test will create and destroy a session.

Solution
========

By passing "--no-wait" to the session destroy command, the step time
is reduced from 500-600ms to ~20ms. The overall test time is
reduced (when running without root tests) from ~150s to ~40s.

Using "--no-wait" with the session destroy seems safe in this case as
the session stop is called before, which will finalize the writes to
disk.

Known drawbacks
===============

The patch causes errors similar to the following to be logged to
stderr:

```
PERROR - 11:55:26.730314528 [Rotation]: sendmsg: Broken pipe (in lttcomm_send_unix_sock() at unix.cpp:300)
Error: Failed to send result of the destruction of session "valid_filter" to client
```

Change-Id: Ic005116bbe910cb3da3e99aa85dc90244ed72f5b
Signed-off-by: Kienan Stewart <kstewart@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
tests/regression/tools/filtering/test_valid_filter
tests/utils/utils.sh

index cd5b1a3b94f1a620097fcaad0db6118e9ec32b98..0c7ac0bdd5e00f419063f07ac0e18922623ecb42 100755 (executable)
@@ -110,7 +110,7 @@ function test_valid_filter
        stop_lttng_tracing_ok $SESSION_NAME
 
        # Destroy session
-       destroy_lttng_session_ok $SESSION_NAME
+       destroy_lttng_session_ok $SESSION_NAME --no-wait
 
        stats=`"$BABELTRACE_BIN" $trace_path | $STATS_BIN --tracepoint $event_name`
 
index 27816deddd9c25b1581515471e58ee76c00dd761..c1d702e823c33120f96b256df93bd35044a73d8e 100644 (file)
@@ -1691,9 +1691,10 @@ function destroy_lttng_session ()
        local withtap=$1
        local expected_to_fail=$2
        local sess_name=$3
+       shift 3
 
        _run_lttng_cmd "$OUTPUT_DEST" "$ERROR_OUTPUT_DEST" \
-               destroy $sess_name
+               destroy $sess_name $@
        ret=$?
        if [[ $expected_to_fail -eq "1" ]]; then
                test "$ret" -ne "0"
This page took 0.02683 seconds and 4 git commands to generate.