File tree 1 file changed +6
-5
lines changed 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -3835,7 +3835,7 @@ func TestConnection_NewWatcher_concurrent(t *testing.T) {
3835
3835
var wg sync.WaitGroup
3836
3836
wg .Add (testConcurrency )
3837
3837
3838
- var ret error
3838
+ errors := make ( chan error , testConcurrency )
3839
3839
for i := 0 ; i < testConcurrency ; i ++ {
3840
3840
go func (i int ) {
3841
3841
defer wg .Done ()
@@ -3846,21 +3846,22 @@ func TestConnection_NewWatcher_concurrent(t *testing.T) {
3846
3846
close (events )
3847
3847
})
3848
3848
if err != nil {
3849
- ret = err
3849
+ errors <- err
3850
3850
} else {
3851
3851
select {
3852
3852
case <- events :
3853
3853
case <- time .After (time .Second ):
3854
- ret = fmt .Errorf ("Unable to get an event %d" , i )
3854
+ errors <- fmt .Errorf ("Unable to get an event %d" , i )
3855
3855
}
3856
3856
watcher .Unregister ()
3857
3857
}
3858
3858
}(i )
3859
3859
}
3860
3860
wg .Wait ()
3861
+ close (errors )
3861
3862
3862
- if ret != nil {
3863
- t .Fatalf ("An error found: %s" , ret )
3863
+ for err := range errors {
3864
+ t .Errorf ("An error found: %s" , err )
3864
3865
}
3865
3866
}
3866
3867
You can’t perform that action at this time.
0 commit comments