]> Cypherpunks.ru repositories - gostls13.git/commit
sync: improve linearity test robustness
authorMichael Anthony Knyszek <mknyszek@google.com>
Fri, 10 Jun 2022 18:47:37 +0000 (18:47 +0000)
committerMichael Knyszek <mknyszek@google.com>
Mon, 13 Jun 2022 20:16:01 +0000 (20:16 +0000)
commit56bc3098f4ed42b272a45c246dcd42d28d89a69a
tree5379cae0320a55ac2b59204d845914d882f24265
parent1fe2810f9ca0dcd34e473f852102e2a49d45d7d8
sync: improve linearity test robustness

This change improves the robustness of the locklinear test in the
following ways:

* It removes allocations from the timing, which may be very variable if
  we're unlucky.
* It ensures that goroutines are properly cleaned up before the test
  function returns, reducing the chance that they bleed into repeat
  attempts. It also stops timing before this cleanup.

Fixes #32986.

Change-Id: I3a8096e6922f23d899ad602e2845bdfc639ed742
Reviewed-on: https://go-review.googlesource.com/c/go/+/409894
Reviewed-by: Michael Pratt <mpratt@google.com>
src/sync/mutex_test.go