Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CI] Ensure large response can fit into 3 messages #104729

Merged
merged 1 commit into from
Jan 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)));
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I chose 1.5 as the upper bound since testSmallFullResponsesAreSentDirectly uses 0.5 as the upper bound.

final var response = request.createResponse(RestStatus.OK, content);
assertThat(response, instanceOf(FullHttpResponse.class));
final var promise = embeddedChannel.newPromise();
Expand Down