Skip to content

Commit

Permalink
This is just trying to get GHA flakes out of the way.. slow down the …
Browse files Browse the repository at this point in the history
…HTTP client call return
  • Loading branch information
burmanm committed Aug 21, 2023
1 parent e55f3cf commit ffb6724
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*/
package com.datastax.mgmtapi;

import static io.netty.util.CharsetUtil.UTF_8;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatCode;
import static org.awaitility.Awaitility.await;
Expand Down Expand Up @@ -787,6 +788,7 @@ public void testAsyncRepair() throws IOException, URISyntaxException, Interrupte
.atMost(Duration.ofMinutes(5))
.untilAsserted(
() -> {
client.get()
Pair<Integer, String> getJobDetailsResponse =
client
.get(getJobDetailsUri.toURL())
Expand Down Expand Up @@ -1013,13 +1015,11 @@ private String responseAsString(FullHttpResponse r) {
}

private Pair<Integer, String> responseAsCodeAndBody(FullHttpResponse r) {
if (r.content().readableBytes() > 0) {
byte[] result = new byte[r.content().readableBytes()];
r.content().readBytes(result);
String payload = new String(result);
return Pair.of(r.status().code(), payload);
FullHttpResponse copy = r.copy();
if (copy.content().readableBytes() > 0) {
return Pair.of(copy.status().code(), copy.content().toString(UTF_8));
}

return Pair.of(r.status().code(), null);
return Pair.of(copy.status().code(), null);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ private CompletableFuture<FullHttpResponse> buildAndSendRequest(HttpMethod metho
request.headers().set(HttpHeaderNames.HOST, url.getHost());

// Send the HTTP request.
client.writeAndFlush(request);
client.writeAndFlush(request).awaitUninterruptibly();

return result;
}
Expand Down

0 comments on commit ffb6724

Please sign in to comment.