From 91fdec209b6318219e98d21d919b7dda301fabf2 Mon Sep 17 00:00:00 2001 From: Fedor Korotkiy Date: Mon, 17 Apr 2023 14:03:06 +0400 Subject: [PATCH] Fix rwmutex test --- rwmutex/rwmutex_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rwmutex/rwmutex_test.go b/rwmutex/rwmutex_test.go index 6433083..6ff5a2e 100644 --- a/rwmutex/rwmutex_test.go +++ b/rwmutex/rwmutex_test.go @@ -5,6 +5,7 @@ import ( "runtime" "sync/atomic" "testing" + "time" ) func parallelReader(m *RWMutex, clocked, cunlock, cdone chan bool) { @@ -98,7 +99,6 @@ func HammerRWMutex(gomaxprocs, numReaders, numIterations int) { } func TestRWMutexReadWrite(t *testing.T) { - timeout := time.After(5 * time.Second) done := make(chan bool) go func() { rwm := New() @@ -108,7 +108,7 @@ func TestRWMutexReadWrite(t *testing.T) { }() select { - case <-timeout: + case <-time.After(time.Second): case <-done: t.Fatal("Test finished, must be deadlock") }