Skip to content

Conversation

dpaks
Copy link

@dpaks dpaks commented May 22, 2021

The test calls testing.AllocsPerRun with a count of 1.
AllocsPerRun sets runtime.GOMAXPROCS to 1, but it doesn't prevent the runtime from descheduling a goroutine
and performing an allocation somewhere in the background.
This commit changes the test to use a number of runs large enough to average away the occasional noisy allocation.

Fixes golang/go#45809

The test calls testing.AllocsPerRun with a count of 1.
AllocsPerRun sets runtime.GOMAXPROCS to 1, but it doesn't prevent the runtime from descheduling a goroutine
and performing an allocation somewhere in the background.
This commit changes the test to use a number of runs large enough to average away the occasional noisy allocation.

Fixes golang/go#45809
@google-cla google-cla bot added the cla: yes label May 22, 2021
@gopherbot
Copy link
Contributor

This PR (HEAD: 1606b69) has been imported to Gerrit for code review.

Please visit https://go-review.googlesource.com/c/text/+/321737 to see it.

Tip: You can toggle comments from me using the comments slash command (e.g. /comments off)
See the Wiki page for more info

@gopherbot
Copy link
Contributor

Message from Go Bot:

Patch Set 1:

Congratulations on opening your first change. Thank you for your contribution!

Next steps:
A maintainer will review your change and provide feedback. See
https://golang.org/doc/contribute.html#review for more info and tips to get your
patch through code review.

Most changes in the Go project go through a few rounds of revision. This can be
surprising to people new to the project. The careful, iterative review process
is our way of helping mentor contributors and ensuring that their contributions
have a lasting impact.

During May-July and Nov-Jan the Go project is in a code freeze, during which
little code gets reviewed or merged. If a reviewer responds with a comment like
R=go1.11 or adds a tag like "wait-release", it means that this CL will be
reviewed as part of the next development cycle. See https://golang.org/s/release
for more details.


Please don’t reply on this GitHub thread. Visit golang.org/cl/321737.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Deepak S:

Patch Set 1:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/321737.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Ian Lance Taylor:

Patch Set 1: Run-TryBot+1


Please don’t reply on this GitHub thread. Visit golang.org/cl/321737.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Go Bot:

Patch Set 1:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/321737.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Go Bot:

Patch Set 1: TryBot-Result+1

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/321737.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Bryan C. Mills:

Patch Set 1: Run-TryBot+1 Code-Review+2


Please don’t reply on this GitHub thread. Visit golang.org/cl/321737.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Michael Knyszek:

Patch Set 1: Trust+1


Please don’t reply on this GitHub thread. Visit golang.org/cl/321737.
After addressing review feedback, remember to publish your drafts!

gopherbot pushed a commit that referenced this pull request May 24, 2021
AllocsPerRun sets runtime.GOMAXPROCS to 1, but it doesn't prevent the runtime from descheduling a goroutine
and performing an allocation somewhere in the background.
This commit changes the test to use a number of runs large enough to average away the occasional noisy allocation.

Fixes golang/go#45809

Change-Id: Ibf904016d0c067740469c8e861079611440222a1
GitHub-Last-Rev: 1606b69
GitHub-Pull-Request: #23
Reviewed-on: https://go-review.googlesource.com/c/text/+/321737
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Trust: Michael Knyszek <mknyszek@google.com>
@gopherbot
Copy link
Contributor

Message from Bryan C. Mills:

Patch Set 1:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/321737.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

This PR is being closed because golang.org/cl/321737 has been merged.

@gopherbot gopherbot closed this May 24, 2021
@dpaks
Copy link
Author

dpaks commented May 24, 2021

Thanks for merging! :)

xhit pushed a commit to xhit/text that referenced this pull request Oct 10, 2022
AllocsPerRun sets runtime.GOMAXPROCS to 1, but it doesn't prevent the runtime from descheduling a goroutine
and performing an allocation somewhere in the background.
This commit changes the test to use a number of runs large enough to average away the occasional noisy allocation.

Fixes golang/go#45809

Change-Id: Ibf904016d0c067740469c8e861079611440222a1
GitHub-Last-Rev: 1606b69
GitHub-Pull-Request: golang#23
Reviewed-on: https://go-review.googlesource.com/c/text/+/321737
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Trust: Michael Knyszek <mknyszek@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

x/text/language: TestBestMatchAlloc failures with "got 1.000000; want 0"
2 participants