aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2018-05-07 20:27:06 +0200
committerDmitry Vyukov <dvyukov@google.com>2018-05-07 20:27:06 +0200
commit02e34016386c3face10db46ec2bbf37a47f7ea66 (patch)
tree919f10d6ca281e3d514ff8d4478f5d7edb35bb4f
parentbdff58b1a1c471bafaf6825bab7e7ff454dddfea (diff)
pkg/csource: skip tests under race detector
csource tests consume too much memory under race detector (>1GB), and periodically timeout on Travis. So we skip them.
-rw-r--r--pkg/csource/race_test.go23
1 files changed, 23 insertions, 0 deletions
diff --git a/pkg/csource/race_test.go b/pkg/csource/race_test.go
new file mode 100644
index 000000000..5f75f186a
--- /dev/null
+++ b/pkg/csource/race_test.go
@@ -0,0 +1,23 @@
+// Copyright 2018 syzkaller project authors. All rights reserved.
+// Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
+
+// +build race
+
+package csource
+
+import (
+ "fmt"
+ "os"
+ "strings"
+)
+
+func init() {
+ // csource tests consume too much memory under race detector (>1GB),
+ // and periodically timeout on Travis. So we skip them.
+ for _, arg := range os.Args[1:] {
+ if strings.Contains(arg, "-test.short") {
+ fmt.Printf("skipping race testing in short mode\n")
+ os.Exit(1)
+ }
+ }
+}