Skip to content

Loosen test deadlines to reduce spurious failures in Swift CI #251

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 25, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion tests/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@ TESTS= \
dispatch_select \
$(ADDITIONAL_TESTS)

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

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

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

DISPATCH_TESTS_CFLAGS=-Wall -Wno-deprecated-declarations $(MARCH_FLAGS)
DISPATCH_TESTS_CFLAGS=-Wall -Wno-deprecated-declarations $(MARCH_FLAGS) $(CI_CFLAGS)
AM_CFLAGS=$(DISPATCH_TESTS_CFLAGS) $(CBLOCKS_FLAGS) $(BSD_OVERLAY_CFLAGS)
AM_OBJCFLAGS=$(DISPATCH_TESTS_CFLAGS) $(CBLOCKS_FLAGS)
AM_CXXFLAGS=$(DISPATCH_TESTS_CFLAGS) $(CXXBLOCKS_FLAGS) $(BSD_OVERLAY_CFLAGS)
Expand Down
4 changes: 4 additions & 0 deletions tests/dispatch_drift.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@
#include <bsdtests.h>
#include "dispatch_test.h"

#if LENIENT_DEADLINES
#define ACCEPTABLE_DRIFT 0.1
#else
#define ACCEPTABLE_DRIFT 0.001
#endif

int
main(int argc __attribute__((unused)), char* argv[] __attribute__((unused)))
Expand Down
4 changes: 3 additions & 1 deletion tests/dispatch_starfish.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@
#define COUNT 1000ul
#define LAPS 10ul

#if TARGET_OS_EMBEDDED
#if LENIENT_DEADLINES
#define ACCEPTABLE_LATENCY 10000
#elif TARGET_OS_EMBEDDED
#define ACCEPTABLE_LATENCY 3000
#else
#define ACCEPTABLE_LATENCY 1000
Expand Down