@@ -43,7 +43,9 @@ public class ResponsePublisherTimeoutIntegrationTest extends S3IntegrationTestBa
4343
4444 private static final String BUCKET = temporaryBucketName (GetObjectIntegrationTest .class );
4545 private static final String KEY = "TestKey" ;
46- private static final String CONTENT = "Hello" ;
46+ // Large enough to trigger StreamedHttpResponse instead of FullHttpResponse in Netty.
47+ // FullHttpResponse releases the connection immediately, defeating pool-exhaustion tests.
48+ private static final int CONTENT_LENGTH = 2 * 1024 * 1024 ;
4749 private static final GetObjectRequest getObjectRequest = GetObjectRequest .builder ()
4850 .bucket (BUCKET )
4951 .key (KEY )
@@ -61,7 +63,7 @@ public static void setupFixture() throws IOException {
6163 s3 .putObject (PutObjectRequest .builder ()
6264 .bucket (BUCKET )
6365 .key (KEY )
64- .build (), RequestBody .fromString ( CONTENT ));
66+ .build (), RequestBody .fromBytes ( new byte [ CONTENT_LENGTH ] ));
6567 }
6668
6769 @ AfterClass
@@ -87,7 +89,7 @@ public void defaultTimeout_firstPublisherConsumed_secondRequestSucceeds() {
8789 CompletableFuture <ResponsePublisher <GetObjectResponse >> get2 = getObjectWithDefaultTimeoutPublisher ();
8890
8991 GetObjectResponse getObjectResponse = get2 .join ().response ();
90- assertThat (getObjectResponse .contentLength ()).isEqualTo (CONTENT . length () );
92+ assertThat (getObjectResponse .contentLength ()).isEqualTo (CONTENT_LENGTH );
9193 }
9294
9395 @ Test
@@ -97,7 +99,7 @@ public void defaultTimeout_cancelFirstRequestFuture_secondRequestSucceeds() {
9799 CompletableFuture <ResponsePublisher <GetObjectResponse >> get2 = getObjectWithDefaultTimeoutPublisher ();
98100
99101 GetObjectResponse getObjectResponse = get2 .join ().response ();
100- assertThat (getObjectResponse .contentLength ()).isEqualTo (CONTENT . length () );
102+ assertThat (getObjectResponse .contentLength ()).isEqualTo (CONTENT_LENGTH );
101103 }
102104
103105 @ Test
@@ -107,7 +109,7 @@ public void customTimeout_waitForTimeout_secondRequestSucceeds() throws Interrup
107109 CompletableFuture <ResponsePublisher <GetObjectResponse >> get2 = getObjectWithDefaultTimeoutPublisher ();
108110
109111 GetObjectResponse getObjectResponse = get2 .join ().response ();
110- assertThat (getObjectResponse .contentLength ()).isEqualTo (CONTENT . length () );
112+ assertThat (getObjectResponse .contentLength ()).isEqualTo (CONTENT_LENGTH );
111113 }
112114
113115 private CompletableFuture <ResponsePublisher <GetObjectResponse >> getObjectWithDefaultTimeoutPublisher () {
0 commit comments