Commit 4c178f87 authored by Juan Batiz-Benet's avatar Juan Batiz-Benet

close conns directly in tests

parent b29367a9
......@@ -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()
}
......
......@@ -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()
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment