]> Cypherpunks repositories - gostls13.git/commit
runtime: fix preemption sensitivity in TestTinyAllocIssue37262
authorAustin Clements <austin@google.com>
Mon, 22 Nov 2021 20:33:01 +0000 (15:33 -0500)
committerAustin Clements <austin@google.com>
Mon, 29 Nov 2021 19:45:58 +0000 (19:45 +0000)
commitf598e2962d3a358b59faa68471b6ed378fc68806
tree796f6a3fddbb2b85db17bffa8ca68c663b73a5ab
parent61ff5019687c125910c48c22d672a9b6985ee61e
runtime: fix preemption sensitivity in TestTinyAllocIssue37262

TestTinyAllocIssue37262 assumes that all of its allocations will come
from the same tiny allocator (that is, the same P), and that nothing
else will allocate from that tiny allocator while it's running. It can
fail incorrectly if these assumptions aren't met.

Fix this potential test flakiness by disabling preemption during this
test.

As far as I know, this has never happened on the builders. It was
found by mayMoreStackPreempt.

Change-Id: I59f993e0bdbf46a9add842d0e278415422c3f804
Reviewed-on: https://go-review.googlesource.com/c/go/+/366994
Trust: Austin Clements <austin@google.com>
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
src/runtime/export_test.go
src/runtime/malloc_test.go