aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2020-10-01 14:31:19 +0200
committerDmitry Vyukov <dvyukov@google.com>2020-10-01 15:03:39 +0200
commit483ff3543746ca3dc97eac8f506564f4e617a8f2 (patch)
treee6d6dc8515198bc2fbbfa66cc69fc9ea3812dbe4
parent8441eb82f3a1a4d03eb0e194e91bc86017ab4466 (diff)
prog: reduce size of tests in race mode
More race timeouts on CI. Exclude more tests. This reduces prog test time fron 81 to 15 sec with GOMAXPROCS=1.
-rw-r--r--prog/export_test.go11
-rw-r--r--prog/mutation_test.go3
-rw-r--r--prog/prog_test.go3
3 files changed, 17 insertions, 0 deletions
diff --git a/prog/export_test.go b/prog/export_test.go
index 8e31a036b..a007ed3ce 100644
--- a/prog/export_test.go
+++ b/prog/export_test.go
@@ -57,6 +57,7 @@ func testEachTarget(t *testing.T, fn func(t *testing.T, target *Target)) {
for _, target := range AllTargets() {
target := target
t.Run(fmt.Sprintf("%v/%v", target.OS, target.Arch), func(t *testing.T) {
+ skipTargetRace(t, target)
t.Parallel()
fn(t, target)
})
@@ -76,12 +77,22 @@ func testEachTargetRandom(t *testing.T, fn func(t *testing.T, target *Target, rs
target := target
rs := rand.NewSource(rs0.Int63())
t.Run(fmt.Sprintf("%v/%v", target.OS, target.Arch), func(t *testing.T) {
+ skipTargetRace(t, target)
t.Parallel()
fn(t, target, rs, iters)
})
}
}
+func skipTargetRace(t *testing.T, target *Target) {
+ // Race execution is slow and we are getting timeouts on CI.
+ // For tests that run for all targets, leave only 2 targets,
+ // this should be enough to detect some races.
+ if raceEnabled && (target.OS != "test" || target.Arch != "64" && target.Arch != "32") {
+ t.Skip("skipping all but test/64 targets in race mode")
+ }
+}
+
func initBench(b *testing.B) (*Target, func()) {
olddebug := debug
debug = false
diff --git a/prog/mutation_test.go b/prog/mutation_test.go
index f17886a61..6dfa15d63 100644
--- a/prog/mutation_test.go
+++ b/prog/mutation_test.go
@@ -81,6 +81,9 @@ mutate_integer(0x0, 0x1, 0x1, 0x1, 0x0, 0x1, 0x0, 0x0, 0x1)`,
}
func TestMutateArgument(t *testing.T) {
+ if raceEnabled {
+ t.Skip("skipping in race mode, too slow")
+ }
tests := [][2]string{
// Mutate an integer with a higher priority than the boolean arguments.
{
diff --git a/prog/prog_test.go b/prog/prog_test.go
index cff8bc1a0..6586d1a1d 100644
--- a/prog/prog_test.go
+++ b/prog/prog_test.go
@@ -142,6 +142,9 @@ func TestVmaType(t *testing.T) {
// deserialized for another arch. This happens when managers exchange
// programs via hub.
func TestCrossTarget(t *testing.T) {
+ if raceEnabled {
+ t.Skip("skipping in race mode, too slow")
+ }
t.Parallel()
const OS = "linux"
var archs []string