Test bug: Fix server connections not closing in TestEchoWithMessaging

Signed-off-by: Darren Stahl <darst@microsoft.com>
This commit is contained in:
Darren Stahl
2017-08-04 10:24:26 -07:00
parent c57b87d6d4
commit 3d52dc4a97
2 changed files with 7 additions and 3 deletions
+3 -1
View File
@@ -367,11 +367,11 @@ func TestEchoWithMessaging(t *testing.T) {
OutputBufferSize: 65536,
}
l, err := ListenPipe(testPipeName, &c)
if err != nil {
t.Fatal(err)
}
defer l.Close()
listenerDone := make(chan bool)
clientDone := make(chan bool)
go func() {
@@ -380,6 +380,8 @@ func TestEchoWithMessaging(t *testing.T) {
if e != nil {
t.Fatal(e)
}
defer conn.Close()
time.Sleep(500 * time.Millisecond) // make *sure* we don't begin to read before eof signal is sent
io.Copy(conn, conn)
conn.(CloseWriter).CloseWrite()