]> Cypherpunks.ru repositories - gostls13.git/commit
sync: move lock linearity test and treat it like a performance test
authorMichael Anthony Knyszek <mknyszek@google.com>
Fri, 10 Jun 2022 16:21:46 +0000 (16:21 +0000)
committerMichael Knyszek <mknyszek@google.com>
Mon, 13 Jun 2022 20:15:55 +0000 (20:15 +0000)
commit1fe2810f9ca0dcd34e473f852102e2a49d45d7d8
tree429e31e7529c6066e3529e96078107f85afce083
parent6130461149020d2b4b91fb183afa388a211cadc5
sync: move lock linearity test and treat it like a performance test

This change moves test/locklinear.go into the sync package tests, and
adds a bit of infrastructure since there are other linearity-checking
tests that could benefit from it too. This infrastructure is also
different than what test/locklinear.go does: instead of trying really
hard to get at least one success, we instead treat this like a
performance test and look for a significant difference via a t-test.

This makes the methodology behind the tests more rigorous, and should
reduce flakiness as transient noise should produce an insignificant
result. A follow-up CL does more to make these tests even more robust.

For #32986.

Change-Id: I408c5f643962b70ea708930edb4ac9df1c6123ce
Reviewed-on: https://go-review.googlesource.com/c/go/+/411396
Reviewed-by: Michael Pratt <mpratt@google.com>
src/internal/testenv/testenv.go
src/internal/testmath/bench.go [new file with mode: 0644]
src/sync/mutex_test.go
test/locklinear.go [deleted file]