]> Cypherpunks repositories - gostls13.git/commit
internal/sync: add test from issue 70970
authorMichael Anthony Knyszek <mknyszek@google.com>
Mon, 6 Jan 2025 18:23:21 +0000 (18:23 +0000)
committerGopher Robot <gobot@golang.org>
Mon, 6 Jan 2025 19:54:59 +0000 (11:54 -0800)
commit3f002abb60b86a851e190d9246278aa53db11f87
treef484866aa4bdd5189c79e785e0686b69bfc7b2ed
parent7a2e88e9117e838f258b175fa535f671396d13da
internal/sync: add test from issue 70970

This test checks a use-case of sync.Map that's expected to be more
common in Go 1.24 and beyond, as a concurrent weak cache.

The test will also fail if CompareAndSwap is not properly atomic with
CompareAndDelete, which is what #70970 is actually about. We should have
more explicit tests checking mutual atomicity of operations, but
for now this is OK, and still useful.

For #70970.

Change-Id: I6db508660691586a8af9ad511c9a96432d333343
Reviewed-on: https://go-review.googlesource.com/c/go/+/640737
Reviewed-by: David Chase <drchase@google.com>
Auto-Submit: Michael Knyszek <mknyszek@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
src/internal/sync/hashtriemap_test.go