Skip to content

internal/coverage/cfile: snapshot test is brittle w/ respect to -coverpkg #67951

@thanm

Description

@thanm

At tip, if you run the internal/coverage/cfile tests with -coverpkg set to something that does include cfile, you get:

     $ cd `go env GOROOT`
     $ cd src/internal/coverage
     $ go test -coverpkg=internal/coverage/decodecounter ./...
     ...
      --- FAIL: TestCoverageSnapshot (0.00s)
          ts_test.go:102: 0.276074 0.276074
          ts_test.go:104: erroneous snapshots, C1 >= C2 = true C1=0.276074 C2=0.276074

This is happening because the test is calling out to a function that it expects will bump up the coverage percentage, but that func is not being instrumented.

The test needs to be rewritten to make it a bit more robust.

Metadata

Metadata

Assignees

Labels

FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions