Skip to content

Commit cbe5470

Browse files
committed
Fix testLogsSlowInboundProcessing
This test creates an incorrectly-serialized handshake which cannot be validated, and elastic#121747 made that validation compulsory. This test corrects the serialization. Closes elastic#121816
1 parent a33708d commit cbe5470

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
@@ -387,9 +387,6 @@ tests:
387387
issue: https://github.com/elastic/elasticsearch/issues/121672
388388
- class: org.elasticsearch.xpack.esql.qa.multi_node.EsqlSpecIT
389389
issue: https://github.com/elastic/elasticsearch/issues/121411
390-
- class: org.elasticsearch.transport.InboundHandlerTests
391-
method: testLogsSlowInboundProcessing
392-
issue: https://github.com/elastic/elasticsearch/issues/121816
393390
- class: org.elasticsearch.smoketest.DocsClientYamlTestSuiteIT
394391
method: test {yaml=reference/cat/health/cat-health-no-timestamp-example}
395392
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)