From 2fd7adffc4120ef5a39731265d8880744933a9a7 Mon Sep 17 00:00:00 2001 From: Adrien Delorme Date: Wed, 1 May 2019 11:46:48 +0200 Subject: [PATCH] add tests for ListenRangeConfig.Listen --- common/net/configure_port_test.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/common/net/configure_port_test.go b/common/net/configure_port_test.go index 5117a70d0..8f01ade46 100644 --- a/common/net/configure_port_test.go +++ b/common/net/configure_port_test.go @@ -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()