]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test-barrier: just make this a slow test
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 12 Sep 2018 07:55:39 +0000 (09:55 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 13 Sep 2018 10:07:34 +0000 (12:07 +0200)
test-barrier was using a custom mechanism to skip itself. Let's
just follow the normal scheme.

src/test/test-barrier.c

index d2afd92f63b808f6f369efa4a126f6c714a5e37d..c59fe03e92af3a490c01fe9922cca58b6421bf14 100644 (file)
@@ -16,6 +16,7 @@
 
 #include "barrier.h"
 #include "util.h"
+#include "tests.h"
 
 /* 20ms to test deadlocks; All timings use multiples of this constant as
  * alarm/sleep timers. If this timeout is too small for slow machines to perform
@@ -419,19 +420,16 @@ TEST_BARRIER(test_barrier_pending_exit,
         TEST_BARRIER_WAIT_SUCCESS(pid2));
 
 int main(int argc, char *argv[]) {
-        /*
-         * This test uses real-time alarms and sleeps to test for CPU races
-         * explicitly. This is highly fragile if your system is under load. We
-         * already increased the BASE_TIME value to make the tests more robust,
-         * but that just makes the test take significantly longer. Hence,
-         * disable the test by default, so it will not break CI.
-         */
-        if (argc < 2)
-                return EXIT_TEST_SKIP;
-
+        log_set_max_level(LOG_INFO);
         log_parse_environment();
         log_open();
 
+        if (!slow_tests_enabled()) {
+                log_notice("%s: slow tests are disabled, exiting.",
+                           program_invocation_short_name);
+                return EXIT_TEST_SKIP;
+        }
+
         test_barrier_sync();
         test_barrier_wait_next();
         test_barrier_wait_next_twice();