Skip to content

Commit

Permalink
Add tps and clients closing to `capped_transport_buffer_should_not_re…
Browse files Browse the repository at this point in the history
…sult_in_hang`
  • Loading branch information
Darkren committed Jun 20, 2019
1 parent e2345a4 commit 8daa622
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion pkg/dmsg/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -742,7 +742,7 @@ func TestServer_Serve(t *testing.T) {
// block on `Write`
go func() {
_, err = aWrTransport.Write(msg)
require.NoError(t, err)
require.Error(t, err)
}()

// wait till it's definitely blocked
Expand All @@ -766,7 +766,23 @@ func TestServer_Serve(t *testing.T) {

require.Equal(t, recBuff, msg)
}

err = aWrTransport.Close()
require.NoError(t, err)

err = bWrTransport.Close()
require.NoError(t, err)

err = aRdTransport.Close()
require.NoError(t, err)

err = a.Close()
require.NoError(t, err)

err = b.Close()
require.NoError(t, err)
})

}

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

0 comments on commit 8daa622

Please sign in to comment.