Skip to content

Commit 9f0551a

Browse files
authored
[8.16] [Test] Flush response body for progress (#115177) (#115613)
* [Test] Flush response body for progress (#115177) In JDK23, response headers are no longer always immediately sent. See also https://bugs.openjdk.org/browse/JDK-8331847 This PR adds flush call for the response body to make progress. Resolves: #115145 Resolves: #115164 (cherry picked from commit 8c23fd7) * unmute
1 parent 194dc1d commit 9f0551a

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

modules/repository-s3/src/test/java/org/elasticsearch/repositories/s3/S3BlobContainerRetriesTests.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -573,16 +573,16 @@ public void handle(HttpExchange exchange) throws IOException {
573573
),
574574
-1
575575
);
576+
exchange.getResponseBody().flush();
576577
} else if (randomBoolean()) {
577578
final var bytesSent = sendIncompleteContent(exchange, bytes);
578579
if (bytesSent < meaningfulProgressBytes) {
579580
failuresWithoutProgress += 1;
580-
} else {
581-
exchange.getResponseBody().flush();
582581
}
583582
} else {
584583
failuresWithoutProgress += 1;
585584
}
585+
exchange.getResponseBody().flush();
586586
exchange.close();
587587
}
588588
}
@@ -627,6 +627,7 @@ public void handle(HttpExchange exchange) throws IOException {
627627
failureCount += 1;
628628
Streams.readFully(exchange.getRequestBody());
629629
sendIncompleteContent(exchange, bytes);
630+
exchange.getResponseBody().flush();
630631
exchange.close();
631632
}
632633
}

muted-tests.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -355,9 +355,6 @@ tests:
355355
- class: org.elasticsearch.xpack.inference.DefaultEndPointsIT
356356
method: testInferDeploysDefaultE5
357357
issue: https://github.com/elastic/elasticsearch/issues/115361
358-
- class: org.elasticsearch.repositories.s3.S3BlobContainerRetriesTests
359-
method: testReadRetriesAfterMeaningfulProgress
360-
issue: https://github.com/elastic/elasticsearch/issues/115583
361358

362359
# Examples:
363360
#

0 commit comments

Comments
 (0)