@@ -95,11 +95,7 @@ func TestIntegration_ReconnectClient(t *testing.T) {
9595
9696func newFilterBase (cbMsg func ([]byte ) bool ) func ([]byte ) bool {
9797 var readBuf []byte
98- var mu sync.Mutex
9998 return func (b []byte ) (ret bool ) {
100- mu .Lock ()
101- defer mu .Unlock ()
102-
10399 readBuf = append (readBuf , b ... )
104100 ret = false
105101 for {
@@ -270,12 +266,8 @@ func TestIntegration_ReconnectClient_SessionPersistence(t *testing.T) {
270266 }
271267 atomic .AddInt32 (& dialCnt , 1 )
272268 ca , cb := filteredpipe .DetectAndClosePipe (
269+ newFilterBase (func ([]byte ) bool { return false }),
273270 newFilterBase (func (msg []byte ) bool {
274- println (fmt .Sprintf ("msg<- %x" , msg ))
275- return false
276- }),
277- newFilterBase (func (msg []byte ) bool {
278- println (fmt .Sprintf ("msg-> %x" , msg ))
279271 if msg [0 ]& 0xF0 == 0x80 {
280272 atomic .AddInt32 (& subCnt , 1 )
281273 }
@@ -300,7 +292,6 @@ func TestIntegration_ReconnectClient_SessionPersistence(t *testing.T) {
300292
301293 chReceived := make (chan * Message , 100 )
302294 cli .Handle (HandlerFunc (func (msg * Message ) {
303- t .Logf ("message: %v" , msg )
304295 chReceived <- msg
305296 }))
306297 _ , err = cli .Connect (
@@ -337,8 +328,7 @@ func TestIntegration_ReconnectClient_SessionPersistence(t *testing.T) {
337328 }
338329 }
339330 select {
340- case msg := <- chReceived :
341- t .Logf ("received: %v" , msg )
331+ case <- chReceived :
342332 case <- ctx .Done ():
343333 t .Fatal ("Timeout" )
344334 }
@@ -365,8 +355,7 @@ func TestIntegration_ReconnectClient_SessionPersistence(t *testing.T) {
365355 }
366356
367357 select {
368- case msg := <- chReceived :
369- t .Logf ("received: %v" , msg )
358+ case <- chReceived :
370359 case <- ctx .Done ():
371360 t .Fatal ("Timeout" )
372361 }
0 commit comments