Skip to content

Commit f57d003

Browse files
committed
test-barrier: just make this a slow test
test-barrier was using a custom mechanism to skip itself. Let's just follow the normal scheme.
1 parent 0cf29ba commit f57d003

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

src/test/test-barrier.c

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
#include "barrier.h"
1818
#include "util.h"
19+
#include "tests.h"
1920

2021
/* 20ms to test deadlocks; All timings use multiples of this constant as
2122
* alarm/sleep timers. If this timeout is too small for slow machines to perform
@@ -419,19 +420,16 @@ TEST_BARRIER(test_barrier_pending_exit,
419420
TEST_BARRIER_WAIT_SUCCESS(pid2));
420421

421422
int main(int argc, char *argv[]) {
422-
/*
423-
* This test uses real-time alarms and sleeps to test for CPU races
424-
* explicitly. This is highly fragile if your system is under load. We
425-
* already increased the BASE_TIME value to make the tests more robust,
426-
* but that just makes the test take significantly longer. Hence,
427-
* disable the test by default, so it will not break CI.
428-
*/
429-
if (argc < 2)
430-
return EXIT_TEST_SKIP;
431-
423+
log_set_max_level(LOG_INFO);
432424
log_parse_environment();
433425
log_open();
434426

427+
if (!slow_tests_enabled()) {
428+
log_notice("%s: slow tests are disabled, exiting.",
429+
program_invocation_short_name);
430+
return EXIT_TEST_SKIP;
431+
}
432+
435433
test_barrier_sync();
436434
test_barrier_wait_next();
437435
test_barrier_wait_next_twice();

0 commit comments

Comments
 (0)