Skip to content

Commit

Permalink
Add one more case to the failed transport test
Browse files Browse the repository at this point in the history
  • Loading branch information
Darkren committed Jun 18, 2019
1 parent f274870 commit c7aeacd
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions pkg/dmsg/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -589,9 +589,20 @@ func TestServer_Serve(t *testing.T) {

// continue creating transports until the error occurs
for {
ctx := context.Background()
//ctx, _ := context.WithTimeout(context.Background(), 100*time.Millisecond)
if _, err := a.Dial(ctx, bPK); err != nil {
//ctx := context.Background()
ctx, _ := context.WithTimeout(context.Background(), 100*time.Millisecond)
if _, err = a.Dial(ctx, bPK); err != nil {
break
}
}
// must be error
require.Error(t, err)

// the same as above, transport is created by another client
for {
//ctx := context.Background()
ctx, _ := context.WithTimeout(context.Background(), 100*time.Millisecond)
if _, err = b.Dial(ctx, aPK); err != nil {
break
}
}
Expand Down Expand Up @@ -702,6 +713,10 @@ func TestServer_Serve(t *testing.T) {
err = b.Close()
require.NoError(t, err)
})

t.Run("test capped_transport_buffer_should_not_result_in_hang", func(t *testing.T) {

})
}

// Given two client instances (a & b) and a server instance (s),
Expand Down

0 comments on commit c7aeacd

Please sign in to comment.