Skip to content

cmd/go: TestCoverageRuns fails #17699

Closed
Closed
@josharian

Description

@josharian

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.TestingAn issue that has been verified to require only test changes, not just a test failure.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions