mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-12-06 02:57:37 +01:00
mount: close the meta cache after the follow-cancel test joins it
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
06da9a9de7
commit
99254779f1
1 file changed
+10
@@ -286,11 +286,21 @@ func TestMountMetaFollowCancelIsAStop(t *testing.T) {
|
||||
|
||||
ctx, cancel := context.WithCancel(context.Background())
|
||||
stopped := make(chan error, 1)
|
||||
joined := make(chan struct{})
|
||||
var retries atomic.Int32
|
||||
go func() {
|
||||
defer close(joined)
|
||||
stopped <- meta_cache.SubscribeMetaEvents(ctx, wfs.metaCache, wfs.signature, wfs, nil, "/", 0, false,
|
||||
func(int64, error) { retries.Add(1) })
|
||||
}()
|
||||
t.Cleanup(func() {
|
||||
cancel()
|
||||
select {
|
||||
case <-joined:
|
||||
wfs.metaCache.Shutdown()
|
||||
case <-time.After(10 * time.Second):
|
||||
}
|
||||
})
|
||||
|
||||
select {
|
||||
case <-filer.subscribed:
|
||||
|
||||
Reference in new issue
Block a user