Closed
Description
Broken out from #17472.
$ go test -run=TestCoverageRuns cmd/go
--- FAIL: TestCoverageRuns (1.41s)
go_test.go:251: running testgo [test -short -coverpkg=strings strings regexp]
go_test.go:266: standard output:
go_test.go:267: --- FAIL: TestIndexRune (0.00s)
strings_test.go:298: expected no allocations, got 1.000000
FAIL
coverage: 97.9% of statements in strings
FAIL strings 0.082s
ok regexp 0.099s coverage: 19.2% of statements in strings
go_test.go:280: go [test -short -coverpkg=strings strings regexp] failed unexpectedly: exit status 1
FAIL
FAIL cmd/go 3.513s
Looks like the failure is because the coverage instrumentation causes an allocation in TestIndexRune where there wasn't one before, causing the test itself to fail.