We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4613c40 commit a02f809Copy full SHA for a02f809
modules/globallock/locker_test.go
@@ -29,6 +29,11 @@ func TestLocker(t *testing.T) {
29
oldExpiry := redisLockExpiry
30
redisLockExpiry = 5 * time.Second // make it shorter for testing
31
defer func() {
32
+ // Avoid data race.
33
+ // The startExtend goroutine may still be running and reading redisLockExpiry.
34
+ // Wait for a while since it will be stopped soon after Close is called.
35
+ time.Sleep(time.Second)
36
+
37
redisLockExpiry = oldExpiry
38
}()
39
0 commit comments