Skip to content

Commit

Permalink
Finish test for failed accept
Browse files Browse the repository at this point in the history
  • Loading branch information
Darkren committed Jun 16, 2019
1 parent 1852048 commit 59f2159
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions pkg/dmsg/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -603,12 +603,32 @@ func TestServer_Serve(t *testing.T) {
}
}()

ctx, cancel := context.WithTimeout(context.Background(), 1*time.Second)
ctx, cancel := context.WithTimeout(context.Background(), 100*time.Second)
defer cancel()

_, err = a.Dial(ctx, bPK)
require.Error(t, err)

time.Sleep(2 * time.Second)

close(aTpDone)
close(bTpDone)

tpReadWriteWG.Wait()
//require.Error(t, err)
require.NoError(t, aErr)
require.NoError(t, bErr)

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

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

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

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

Expand Down

0 comments on commit 59f2159

Please sign in to comment.