Commit e92a7247 authored by Josh Bleecher Snyder's avatar Josh Bleecher Snyder

fmt: skip malloc test under race detector

Fixes #10778.

Change-Id: I09aab55dec429ec4a023e5ad591b929563cef0d9
Reviewed-on: https://go-review.googlesource.com/9855Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
parent 7c0db1b7
......@@ -949,11 +949,13 @@ var mallocTest = []struct {
var _ bytes.Buffer
func TestCountMallocs(t *testing.T) {
if testing.Short() {
switch {
case testing.Short():
t.Skip("skipping malloc count in short mode")
}
if runtime.GOMAXPROCS(0) > 1 {
case runtime.GOMAXPROCS(0) > 1:
t.Skip("skipping; GOMAXPROCS>1")
case raceenabled:
t.Skip("skipping malloc count under race detector")
}
for _, mt := range mallocTest {
mallocs := testing.AllocsPerRun(100, mt.fn)
......
// Copyright 2015 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// +build !race
package fmt_test
const raceenabled = false
// Copyright 2015 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// +build race
package fmt_test
const raceenabled = true
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment