add tests for ListenRangeConfig.Listen

This commit is contained in:
Adrien Delorme 2019-05-01 11:46:48 +02:00
parent d9e5145de9
commit 2fd7adffc4
1 changed files with 3 additions and 1 deletions

View File

@ -53,8 +53,10 @@ func TestListenRangeConfig_Listen(t *testing.T) {
Min: lockedListener.Port,
Max: lockedListener.Port,
}.Listen(ctx)
if err != context.DeadlineExceeded {
if l != nil {
l.Close()
}
if err != context.DeadlineExceeded {
t.Fatalf("port should be taken, this should timeout: %v", err)
}
cancel()