Description
The TestSanity test in metakv/metakv_test.go has a race between closing the cancel channel and sending the last kv entry to the kveChan channel (https://src.couchbase.org/source/xref/trunk/goproj/src/github.com/couchbase/cbauth/metakv/metakv.go#308)
Error when the cancel channel is closed before the last kv entry is sent:
2023/07/28 11:40:00 Waiting for rows
|
2023/07/28 11:40:00 Observed {/_sanity/key, value, }
|
2023/07/28 11:40:00 Observed {/_sanity/key, new value, }
|
2023/07/28 11:40:00 Observed {/_sanity/secret, secret, }
|
2023/07/28 11:40:00 Observed {/_sanity/secret, , %!s(<nil>)}
|
2023/07/28 11:40:00 Observed {/_sanity/key, , %!s(<nil>)}
|
2023/07/28 11:40:00 receiver is dead
|
--- FAIL: TestSanity (0.01s)
|
sanity.go:62: Starting basic sanity test
|
sanity.go:69: cleaned up /_sanity/ subspace
|
sanity.go:91: Sanity observe loop exited
|
panic: bad mutations size: 4 ([{/_sanity/key [118 97 108 117 101] [2 0 0 0 0 0 0 0] false} {/_sanity/key [110 101 119 32 118 97 108 117 101] [3 0 0 0 0 0 0 0] false} {/_sanity/secret [115 101 99 114 101 116] [4 0 0 0 0 0 0 0] true} {/_sanity/secret [] [] false}]) [recovered]
|
panic: bad mutations size: 4 ([{/_sanity/key [118 97 108 117 101] [2 0 0 0 0 0 0 0] false} {/_sanity/key [110 101 119 32 118 97 108 117 101] [3 0 0 0 0 0 0 0] false} {/_sanity/secret [115 101 99 114 101 116] [4 0 0 0 0 0 0 0] true} {/_sanity/secret [] [] false}])
|
|
goroutine 2446 [running]:
|
testing.tRunner.func1.2({0x102d50ae0, 0x1400030d8a0})
|
/opt/homebrew/Cellar/go/1.20.5/libexec/src/testing/testing.go:1526 +0x1c8
|
testing.tRunner.func1()
|
/opt/homebrew/Cellar/go/1.20.5/libexec/src/testing/testing.go:1529 +0x384
|
panic({0x102d50ae0, 0x1400030d8a0})
|
/opt/homebrew/Cellar/go/1.20.5/libexec/src/runtime/panic.go:884 +0x204
|
github.com/couchbase/cbauth/metakv.doExecuteBasicSanityTest(0x1400030d280, 0x1400030d190)
|
/Users/petersearby/Dev/server/master/goproj/src/github.com/couchbase/cbauth/metakv/sanity.go:136 +0xab8
|
github.com/couchbase/cbauth/metakv.TestSanity(0x1400025b040)
|
/Users/petersearby/Dev/server/master/goproj/src/github.com/couchbase/cbauth/metakv/metakv_test.go:295 +0x190
|
testing.tRunner(0x1400025b040, 0x102de3b48)
|
/opt/homebrew/Cellar/go/1.20.5/libexec/src/testing/testing.go:1576 +0x10c
|
created by testing.(*T).Run
|
/opt/homebrew/Cellar/go/1.20.5/libexec/src/testing/testing.go:1629 +0x368
|
FAIL github.com/couchbase/cbauth/metakv 0.880s
|
FAIL
|
Note that the 5th entry is observed, but not written to the buffer.