Skip to content

Commit 16ff08a

Browse files
Allow stream opening to take longer in the CI pipeline.
1 parent 0f631fb commit 16ff08a

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

tests/stream_test.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,13 @@ int test_open_timeout(char *exe)
1616
INFO_OUT("Testing nl_open_timeout().\n");
1717

1818
DEBUG_OUT("Verifying successful opens occur quickly.\n");
19-
nl_clock_fromnow(CLOCK_MONOTONIC, &after, (struct timespec){.tv_nsec = 5000000}); // 5ms
19+
#ifdef DEBUG
20+
// Things are slower in debug builds and in the CI pipeline
21+
nl_clock_fromnow(CLOCK_MONOTONIC, &after, (struct timespec){.tv_nsec = 150000000}); // 150ms
22+
#else
23+
nl_clock_fromnow(CLOCK_MONOTONIC, &after, (struct timespec){.tv_nsec = 50000000}); // 50ms
24+
#endif /* DEBUG */
25+
2026
fd = nl_open_timeout(exe, O_RDONLY, 0, (struct timespec){.tv_sec = 1, .tv_nsec = 0});
2127
clock_gettime(CLOCK_MONOTONIC, &now);
2228

0 commit comments

Comments
 (0)