From: Francis Deslauriers Date: Tue, 20 Apr 2021 13:52:00 +0000 (-0400) Subject: Fix: tests: discarded notifications: missing `list-triggers` call X-Git-Tag: v2.13.0-rc1~64 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=40b21f0605f1b78e12acc3fbb6fc2c2ddb60cd2f;p=lttng-tools.git Fix: tests: discarded notifications: missing `list-triggers` call I get the following test failure when running the test_notification_notifier_discarded_count test case. # Kernel event notifer error counter ok 1 - Add trigger my_trigger ok 2 - No discarded tracer notification message ok 3 - Trigger 'errors: none' notification message ok 4 - Tracer notification discarded line printed ok 5 - Discarded tracer notification number non-zero as expected ok 6 - Remove trigger my_trigger ok 7 - No `on-event` kernel notifier enabled as expected ok 8 - Add trigger my_trigger ok 9 - No discarded tracer notification message not ok 10 - Trigger 'errors: none' notification message # Failed test 'Trigger 'errors: none' notification message' # in tests/regression/tools/notification/test_notification_notifier_discarded_count:test_kernel_notifier_discarded_count() at line 108. ok 11 - Remove trigger my_trigger This happens because we test the `list-triggers` output on outdated content. We need to call `list-triggers` right before testing the output of it. In this commit, I also changed the number of iteration to 2000 as it's sufficient to generate discarded notifications. Signed-off-by: Francis Deslauriers Signed-off-by: Jérémie Galarneau Change-Id: I66d54f9178f9f37ff2fd899278e77fe50e455c10 --- diff --git a/tests/regression/tools/notification/test_notification_notifier_discarded_count b/tests/regression/tools/notification/test_notification_notifier_discarded_count index 08b014e1e..36fc5c339 100755 --- a/tests/regression/tools/notification/test_notification_notifier_discarded_count +++ b/tests/regression/tools/notification/test_notification_notifier_discarded_count @@ -76,7 +76,7 @@ function test_kernel_notifier_discarded_count # To fill it, we need to generate (16 * 4096)/42 = 1561 notifications. # That number is a bit larger than what we need since some of the space # is lost in subbuffer boundaries. - echo -n "200000" > /proc/lttng-test-filter-event + echo -n "2000" > /proc/lttng-test-filter-event "$FULL_LTTNG_BIN" list-triggers > "$list_triggers_stdout" @@ -100,6 +100,8 @@ function test_kernel_notifier_discarded_count --condition on-event --kernel lttng_test_filter_event \ --action notify + "$FULL_LTTNG_BIN" list-triggers > "$list_triggers_stdout" + # Confirm that the discarded notification line is not present. cat "$list_triggers_stdout" | grep -v --quiet "discarded tracer messages" ok $? "No discarded tracer notification message"