From: Kienan Stewart Date: Thu, 31 Aug 2023 20:06:09 +0000 (-0400) Subject: tests: Use session discarded counter to validate blocking test X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=8e023ed42dff12632a5096a3b2d6c25d144bdbfb;p=lttng-tools.git tests: Use session discarded counter to validate blocking test Motivation ========== On my development machine, the block test takes about 75s to complete, with the majority of the time being used in the infinite blocking test. Solution ======== Using the discarded counter provided by `lttng list SESSION`, the test no longer spends time reading and processing the ~1G of traces with babeltrace2. This reduces the run time of the entire suite from 75s to about 15s. Known drawbacks =============== There's no longer a validation that the trace files written to disk are parseable by a CTF reader. Change-Id: I0ccdef53ef80f1ffe5cfff970b92c3de4ba460ec Signed-off-by: Kienan Stewart Signed-off-by: Jérémie Galarneau --- diff --git a/tests/regression/ust/blocking/test_blocking b/tests/regression/ust/blocking/test_blocking index 0bbc02ddc..51e213090 100755 --- a/tests/regression/ust/blocking/test_blocking +++ b/tests/regression/ust/blocking/test_blocking @@ -134,13 +134,12 @@ function test_ust_blocking_no_discard() start_lttng_tracing_ok $SESSION_NAME LTTNG_UST_ALLOW_BLOCKING=1 run_app stop_lttng_tracing_ok $SESSION_NAME + discarded=$("${XML_EXTRACT}" <("${TESTDIR}/../src/bin/lttng/${LTTNG_BIN}" --mi=xml list --channel="${CHANNEL_NAME}" "${SESSION_NAME}") '//lttng:command/lttng:output/lttng:sessions/lttng:session/lttng:domains/lttng:domain/lttng:channels/lttng:channel/lttng:attributes/lttng:discarded_events') destroy_lttng_session_ok $SESSION_NAME stop_lttng_sessiond - nr_events=$("$BABELTRACE_BIN" $TRACE_PATH 2>/dev/null | wc -l) - - test $nr_events -eq $NUM_EVENT - ok $? "No event lost with UST blocking mode: found $nr_events expect $NUM_EVENT" + test "$(echo "${discarded}" | grep -Eo '[0-9]+')" = "0" + ok $? "No event lost with UST blocking mode: ${discarded}" } plan_tests $NUM_TESTS