From 4c178f87e24f06d59f7b8d4a6992bd8f208fcbc9 Mon Sep 17 00:00:00 2001 From: Juan Batiz-Benet Date: Sun, 19 Oct 2014 07:21:02 -0700 Subject: [PATCH] close conns directly in tests --- net/conn/conn_test.go | 6 +++++- net/conn/secure_conn_test.go | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/net/conn/conn_test.go b/net/conn/conn_test.go index d13749941..889b67a2c 100644 --- a/net/conn/conn_test.go +++ b/net/conn/conn_test.go @@ -60,7 +60,9 @@ func TestCancel(t *testing.T) { default: } - cancel() + c1.Close() + c2.Close() + cancel() // listener // wait to ensure other goroutines run and close things. <-time.After(time.Microsecond * 10) @@ -113,6 +115,8 @@ func TestCloseLeak(t *testing.T) { <-time.After(time.Microsecond * 5) } + c1.Close() + c2.Close() cancel() // close the listener wg.Done() } diff --git a/net/conn/secure_conn_test.go b/net/conn/secure_conn_test.go index 56579887a..be3580693 100644 --- a/net/conn/secure_conn_test.go +++ b/net/conn/secure_conn_test.go @@ -82,7 +82,9 @@ func TestSecureCancel(t *testing.T) { default: } - cancel() + c1.Close() + c2.Close() + cancel() // listener // wait to ensure other goroutines run and close things. <-time.After(time.Microsecond * 10) @@ -137,6 +139,8 @@ func TestSecureCloseLeak(t *testing.T) { <-time.After(time.Microsecond * 5) } + c1.Close() + c2.Close() cancel() // close the listener wg.Done() }