Skip to content

Commit 9e0d42a

Browse files
committed
fix ping tests
1 parent d220d35 commit 9e0d42a

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

dtls/client_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -600,10 +600,10 @@ func TestClientConn_Ping(t *testing.T) {
600600
err = cc.Ping(ctx)
601601
require.NoError(t, err)
602602

603-
ctx, cancel = context.WithTimeout(context.Background(), time.Millisecond*4)
603+
ctx, cancel = context.WithTimeout(context.Background(), time.Microsecond*20)
604604
defer cancel()
605605
err = cc.Ping(ctx)
606-
require.NoError(t, err)
606+
require.Error(t, err)
607607
}
608608

609609
func TestClientConn_HandeShakeFailure(t *testing.T) {

tcp/clientconn_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -478,8 +478,8 @@ func TestClientConn_Ping(t *testing.T) {
478478
err = cc.Ping(ctx)
479479
require.NoError(t, err)
480480

481-
ctx, cancel = context.WithTimeout(context.Background(), time.Millisecond*4)
481+
ctx, cancel = context.WithTimeout(context.Background(), time.Microsecond*20)
482482
defer cancel()
483483
err = cc.Ping(ctx)
484-
require.NoError(t, err)
484+
require.Error(t, err)
485485
}

udp/client_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -553,8 +553,8 @@ func TestClientConn_Ping(t *testing.T) {
553553
err = cc.Ping(ctx)
554554
require.NoError(t, err)
555555

556-
ctx, cancel = context.WithTimeout(context.Background(), time.Millisecond*4)
556+
ctx, cancel = context.WithTimeout(context.Background(), time.Microsecond*20)
557557
defer cancel()
558558
err = cc.Ping(ctx)
559-
require.NoError(t, err)
559+
require.Error(t, err)
560560
}

0 commit comments

Comments
 (0)