Skip to content

Commit 5537a51

Browse files
authored
Fix testLogsSlowInboundProcessing (#121895)
This test creates an incorrectly-serialized handshake which cannot be validated, and #121747 made that validation compulsory. This test corrects the serialization. Closes #121816
1 parent 24bc9fa commit 5537a51

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

muted-tests.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -381,9 +381,6 @@ tests:
381381
issue: https://github.com/elastic/elasticsearch/issues/121672
382382
- class: org.elasticsearch.xpack.esql.qa.multi_node.EsqlSpecIT
383383
issue: https://github.com/elastic/elasticsearch/issues/121411
384-
- class: org.elasticsearch.transport.InboundHandlerTests
385-
method: testLogsSlowInboundProcessing
386-
issue: https://github.com/elastic/elasticsearch/issues/121816
387384
- class: org.elasticsearch.smoketest.DocsClientYamlTestSuiteIT
388385
method: test {yaml=reference/cat/health/cat-health-no-timestamp-example}
389386
issue: https://github.com/elastic/elasticsearch/issues/121867

server/src/test/java/org/elasticsearch/transport/InboundHandlerTests.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -291,8 +291,11 @@ public void testLogsSlowInboundProcessing() throws Exception {
291291
BytesStreamOutput byteData = new BytesStreamOutput();
292292
TaskId.EMPTY_TASK_ID.writeTo(byteData);
293293
// simulate bytes of a transport handshake: vInt transport version then release version string
294-
TransportVersion.writeVersion(remoteVersion, byteData);
295-
byteData.writeString(randomIdentifier());
294+
try (var payloadByteData = new BytesStreamOutput()) {
295+
TransportVersion.writeVersion(remoteVersion, payloadByteData);
296+
payloadByteData.writeString(randomIdentifier());
297+
byteData.writeBytesReference(payloadByteData.bytes());
298+
}
296299
final InboundMessage requestMessage = new InboundMessage(
297300
requestHeader,
298301
ReleasableBytesReference.wrap(byteData.bytes()),

0 commit comments

Comments
 (0)