diff --git a/src/runtime/runtime_test.go b/src/runtime/runtime_test.go index 0f2998b35b..6c628f8903 100644 --- a/src/runtime/runtime_test.go +++ b/src/runtime/runtime_test.go @@ -7,7 +7,10 @@ package runtime_test import ( "flag" "fmt" + "internal/asan" "internal/cpu" + "internal/msan" + "internal/race" "internal/runtime/atomic" "internal/testenv" "io" @@ -329,6 +332,9 @@ func TestAppendGrowthHeap(t *testing.T) { } func TestAppendGrowthStack(t *testing.T) { + if race.Enabled || asan.Enabled || msan.Enabled { + t.Skip("instrumentation breaks this optimization") + } var x []int64 check := func(want int) { if cap(x) != want { @@ -338,7 +344,7 @@ func TestAppendGrowthStack(t *testing.T) { check(0) want := 32 / 8 // 32 is the default for cmd/compile/internal/base.DebugFlags.VariableMakeThreshold - if Raceenabled || testenv.OptimizationOff() { + if testenv.OptimizationOff() { want = 1 } for i := 1; i <= 100; i++ {