File tree 1 file changed +3
-4
lines changed
1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -807,12 +807,14 @@ func TestDecodeMessage(t *testing.T) {
807
807
}
808
808
809
809
func TestConnectionAllowsConcurrentWrites (t * testing.T ) {
810
+ ch := make (chan struct {})
810
811
srvConnVal := atomic.Value {}
811
812
callbacks := CallbacksStruct {
812
813
OnConnectingFunc : func (request * http.Request ) types.ConnectionResponse {
813
814
return types.ConnectionResponse {Accept : true , ConnectionCallbacks : ConnectionCallbacksStruct {
814
815
OnConnectedFunc : func (ctx context.Context , conn types.Connection ) {
815
816
srvConnVal .Store (conn )
817
+ ch <- struct {}{}
816
818
},
817
819
}}
818
820
},
@@ -837,10 +839,7 @@ func TestConnectionAllowsConcurrentWrites(t *testing.T) {
837
839
select {
838
840
case <- timeout .Done ():
839
841
t .Error ("Client failed to connect before timeout" )
840
- default :
841
- if _ , ok := srvConnVal .Load ().(types.Connection ); ok == true {
842
- break
843
- }
842
+ case <- ch :
844
843
}
845
844
846
845
cancel ()
You can’t perform that action at this time.
0 commit comments