From 8daa622902fc2240504b5ee157f3f5dab70e5c21 Mon Sep 17 00:00:00 2001 From: Sir Darkrengarius Date: Thu, 20 Jun 2019 21:10:30 +0300 Subject: [PATCH] Add tps and clients closing to `capped_transport_buffer_should_not_result_in_hang` --- pkg/dmsg/server_test.go | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/pkg/dmsg/server_test.go b/pkg/dmsg/server_test.go index 19ee1a9146..1117c5a629 100644 --- a/pkg/dmsg/server_test.go +++ b/pkg/dmsg/server_test.go @@ -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 @@ -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),