Make sure the tests specify a request total timeout to avoid infinite waits.

Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
This commit is contained in:
Simone Bordet 2023-08-24 17:50:56 +02:00
parent a3e58c07b7
commit c977ea1de9
No known key found for this signature in database
GPG Key ID: 1677D141BCF3584D
2 changed files with 5 additions and 2 deletions

View File

@ -135,7 +135,9 @@ public class HttpClientIdleTimeoutTest extends AbstractTest
Thread.sleep(2 * idleTimeout);
// Make sure we can make another request successfully.
ContentResponse response2 = client.newRequest(newURI(transport)).send();
ContentResponse response2 = client.newRequest(newURI(transport))
.timeout(5, TimeUnit.SECONDS)
.send();
assertEquals(HttpStatus.OK_200, response2.getStatus());
}
}

View File

@ -91,10 +91,11 @@ public class TrailersTest extends AbstractTest
client.newRequest(newURI(transport))
.trailersSupplier(() -> requestTrailers)
.body(body)
.timeout(5, TimeUnit.SECONDS)
.send(listener);
// Write the content first, then the trailers.
output.write(new byte[1024 * 1024]);
output.write(new byte[128 * 1024 * 1024]);
requestTrailers.put(trailerName, trailerValue);
}