test: wait for native request slot release
This commit is contained in:
@@ -785,6 +785,13 @@ func TestServerConcurrentRequestLimitRecovers(t *testing.T) {
|
||||
if response.StatusCode != http.StatusOK {
|
||||
t.Fatalf("expected held request to complete, got %d", response.StatusCode)
|
||||
}
|
||||
deadline := time.Now().Add(time.Second)
|
||||
for server.Stats().ActiveRequests != 0 && time.Now().Before(deadline) {
|
||||
time.Sleep(time.Millisecond)
|
||||
}
|
||||
if stats := server.Stats(); stats.ActiveRequests != 0 {
|
||||
t.Fatalf("request slot was not released after response: %+v", stats)
|
||||
}
|
||||
|
||||
thirdConn, err := net.Dial("tcp", listener.Addr().String())
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user