Skip to content

Commit

Permalink
AMQ-9617: Adjust consumers timeout to avoid race condition on RestTest
Browse files Browse the repository at this point in the history
(cherry picked from commit fa881ad)
  • Loading branch information
jbonofre committed Nov 8, 2024
1 parent 55467fe commit 1104104
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,10 @@ public void testConsumeAsyncTimeout() throws Exception {

// AMQ-9330 - test no 500 error on timeout and instead 204 error
Future<Result> result =
asyncRequest(httpClient, "http://localhost:" + port + "/message/test?readTimeout=2000&type=queue&clientId=test", new StringBuffer());
asyncRequest(httpClient, "http://localhost:" + port + "/message/test?readTimeout=1000&type=queue&clientId=test", new StringBuffer());
// try a second request while the first is running, this should get a 500 error since the first is still running and
// concurrent access to the same consumer is not allowed
Future<Result> errorResult = asyncRequest(httpClient, "http://localhost:" + port + "/message/test?readTimeout=1&type=queue&clientId=test", new StringBuffer());
Future<Result> errorResult = asyncRequest(httpClient, "http://localhost:" + port + "/message/test?readTimeout=10000&type=queue&clientId=test", new StringBuffer());
assertEquals(HttpStatus.INTERNAL_SERVER_ERROR_500, errorResult.get().getResponse().getStatus());
//After the original request finishes, verify 204 and not 500 error
assertEquals(HttpStatus.NO_CONTENT_204, result.get().getResponse().getStatus());
Expand Down

0 comments on commit 1104104

Please sign in to comment.