Repository navigation
fix(ui): count the allocations of a line only in a run without the race detector - #181
Merged
Merged
Conversation
…ce detector The race detector drops what sync.Pool is given at random, so the count of allocations of a line varied by about ten from run to run and failed the test now and then on macOS. The test skips under the race detector, and CI runs the tests once more without it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes
The tests that count the allocations of a new log line failed now and then in CI:
TestText_ANewLineCostsTheSameHoweverLongTheTextfailed on macOS in #179 with 1177 allocations against at most 1176, on a branch that changes no Go code.CI runs the tests only with
-race, and the race detector drops whatsync.Poolis given at random (sync/pool.go,Put), so code that takes from a pool allocates a different number of times on each run. Locally under-racethe difference between a short and a long text went from -11 to +2 over eight runs; without it both counts are 1096 every time.raceOn, from a pair of files with theracebuild tag).go test ./...without the race detector, after a lint failure too, so the counts are still checked on every push.make checkalready ran them that way.Checklist
make checkis greenfeat(ui): ...,fix(nomad): ...