Skip to content

Commit 7b63c3f

Browse files
authored
Merge pull request swiftlang#251 from dgrove-oss/increase-timeouts-for-CI
Loosen test deadlines to reduce spurious failures in Swift CI
2 parents 0b6c22e + 76b44be commit 7b63c3f

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

tests/Makefile.am

+6-1
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,11 @@ TESTS= \
7474
dispatch_select \
7575
$(ADDITIONAL_TESTS)
7676

77+
# For testing in swift.org CI system; make deadlines lenient by default
78+
# to reduce probability of test failures due to machine load.
79+
if HAVE_SWIFT
80+
CI_CFLAGS=-DLENIENT_DEADLINES=1
81+
endif
7782

7883
dispatch_c99_CFLAGS=$(DISPATCH_TESTS_CFLAGS) $(CBLOCKS_FLAGS) -std=c99
7984
dispatch_plusplus_SOURCES=dispatch_plusplus.cpp
@@ -82,7 +87,7 @@ dispatch_priority2_CPPFLAGS=$(AM_CPPFLAGS) -DUSE_SET_TARGET_QUEUE=1
8287

8388
AM_CPPFLAGS=-I$(top_builddir) -I$(top_srcdir)
8489

85-
DISPATCH_TESTS_CFLAGS=-Wall -Wno-deprecated-declarations $(MARCH_FLAGS)
90+
DISPATCH_TESTS_CFLAGS=-Wall -Wno-deprecated-declarations $(MARCH_FLAGS) $(CI_CFLAGS)
8691
AM_CFLAGS=$(DISPATCH_TESTS_CFLAGS) $(CBLOCKS_FLAGS) $(BSD_OVERLAY_CFLAGS)
8792
AM_OBJCFLAGS=$(DISPATCH_TESTS_CFLAGS) $(CBLOCKS_FLAGS)
8893
AM_CXXFLAGS=$(DISPATCH_TESTS_CFLAGS) $(CXXBLOCKS_FLAGS) $(BSD_OVERLAY_CFLAGS)

tests/dispatch_drift.c

+4
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,11 @@
3232
#include <bsdtests.h>
3333
#include "dispatch_test.h"
3434

35+
#if LENIENT_DEADLINES
36+
#define ACCEPTABLE_DRIFT 0.1
37+
#else
3538
#define ACCEPTABLE_DRIFT 0.001
39+
#endif
3640

3741
int
3842
main(int argc __attribute__((unused)), char* argv[] __attribute__((unused)))

tests/dispatch_starfish.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@
3737
#define COUNT 1000ul
3838
#define LAPS 10ul
3939

40-
#if TARGET_OS_EMBEDDED
40+
#if LENIENT_DEADLINES
41+
#define ACCEPTABLE_LATENCY 10000
42+
#elif TARGET_OS_EMBEDDED
4143
#define ACCEPTABLE_LATENCY 3000
4244
#else
4345
#define ACCEPTABLE_LATENCY 1000

0 commit comments

Comments
 (0)