Skip to content

Commit

Permalink
[CI] Ensure large response can fit into 3 messages
Browse files Browse the repository at this point in the history
Lower the upper bound of large response size from
2 times of suggestedMaxAllocationSize to 1.5 so that it be sent over
with 3 messages. This is because the split threshold is 0.99 of
suggestedMaxAllocationSize.

Resolves: elastic#104728
  • Loading branch information
ywangd committed Jan 25, 2024
1 parent 9b4647c commit d055ba9
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -232,14 +232,13 @@ public void testSmallFullResponsesAreSentDirectly() {
assertSame(response, messagesSeen.get(0));
}

@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/104728")
public void testLargeFullResponsesAreSplit() {
final List<Object> messagesSeen = new ArrayList<>();
final var embeddedChannel = new EmbeddedChannel(capturingHandler(messagesSeen), getTestHttpHandler());
embeddedChannel.writeInbound(createHttpRequest("/test"));
final Netty4HttpRequest request = embeddedChannel.readInbound();
final var minSize = (int) NettyAllocator.suggestedMaxAllocationSize();
final var content = new ZeroBytesReference(between(minSize, minSize * 2));
final var content = new ZeroBytesReference(between(minSize, (int) (minSize * 1.5)));
final var response = request.createResponse(RestStatus.OK, content);
assertThat(response, instanceOf(FullHttpResponse.class));
final var promise = embeddedChannel.newPromise();
Expand Down

0 comments on commit d055ba9

Please sign in to comment.