test: wait for native connection slot release
This commit is contained in:
@@ -862,6 +862,13 @@ func TestServerConnectionLimitReleasesAfterRequest(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
firstResponse.Body.Close()
|
||||
deadline := time.Now().Add(time.Second)
|
||||
for server.Stats().ActiveConnections != 0 && time.Now().Before(deadline) {
|
||||
time.Sleep(time.Millisecond)
|
||||
}
|
||||
if stats := server.Stats(); stats.ActiveConnections != 0 {
|
||||
t.Fatalf("connection slot was not released after response: %+v", stats)
|
||||
}
|
||||
|
||||
third, err := net.Dial("tcp", listener.Addr().String())
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user