-
Notifications
You must be signed in to change notification settings - Fork 18.5k
Open
Labels
FeatureRequestIssues asking for a new feature that does not need a proposal.Issues asking for a new feature that does not need a proposal.NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.telemetryx/telemetry issuesx/telemetry issues
Milestone
Description
While investigating a frequent gopls flake (#68659), I encountered several API problems with the countertest package that make it hard (or really impossible) to use correctly.
I believe the sequence of events that leads to the flake in question are:
TestMaincallscountertest.Open, because it must be called once during program execution.- The test setup first performs an initial increment of counter values, since we must inc before the first
ReadasReadCounter(counter.New("unknownCounter"))returns an error rather than succeeding and returning0. ReadCountercalls rotate1 internally. I'm not sure why. SinceTestMainmay have occurred ~minutes ago, it's quite likely that the day has actually changed in the meantime, and so the file rotation invalidates the previous counters.
IMO, all three of these are indicative of an API problem:
- We should probably be able to call
countertest.Openinside each test (albeit not in parallel), to increase test isolation. ReadCounter(counter.New("unknownCounter"))should return the zero value.ReadCountershould probably not callrotate1, but even if it does,countertestshould not be subject to day shifts. We should either stop time, or let thecountertestuser control the progress of time. Otherwise, no test can assert on the output ofRead.
At the very least, we should fix (3), but it would be good to fix (1) and (2) as well.
Metadata
Metadata
Assignees
Labels
FeatureRequestIssues asking for a new feature that does not need a proposal.Issues asking for a new feature that does not need a proposal.NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.telemetryx/telemetry issuesx/telemetry issues