Skip to content

Commit 9c73dcd

Browse files
committed
Lower large file and split codebuilds to reduce build time
1 parent d013835 commit 9c73dcd

File tree

5 files changed

+12
-12
lines changed

5 files changed

+12
-12
lines changed

buildspecs/s3-regression-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ version: 0.2
33
phases:
44
build:
55
commands:
6-
- mvn clean install -P s3-regression-tests -pl :s3-tests -am -T1C $MAVEN_OPTIONS
6+
- mvn clean install -P s3-regression-tests -pl :s3-tests -am -T1C Dregression.test=$REGRESSION_TEST $MAVEN_OPTIONS
77
- echo $MAVEN_OPTIONS
88
finally:
99
- mkdir -p codebuild-test-reports

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -924,9 +924,9 @@
924924
</goals>
925925
<configuration>
926926
<!-- this test needs a lot of memory, we need to increase java heap size or we get OOM in codebuild -->
927-
<argLine>-Xmx12g -Xms4g -XX:+AllowRedefinitionToAddDeleteMethods</argLine>
927+
<argLine>-Xmx12g -Xms4g</argLine>
928928
<includes>
929-
<include>**/*RegressionTesting.java</include>
929+
<include>**/*${regression.test}.java</include>
930930
</includes>
931931
<trimStackTrace>false</trimStackTrace>
932932
<classesDirectory>${project.build.outputDirectory}</classesDirectory>

test/s3-tests/src/it/java/software/amazon/awssdk/services/s3/regression/DownloadStreamingRegressionTesting.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ public class DownloadStreamingRegressionTesting extends BaseS3RegressionTest {
7979
static void init() throws Exception {
8080
tempDirPath = createTempDir("DownloadStreamingIntegrationTesting");
8181
smallObject = uploadObjectSmall(); // 16 KiB
82-
largeObject = uploadObjectLarge(); // 80 MiB
83-
largeObjectMulti = uploadMultiPartObject(); // 80 MiB, default multipart config
82+
largeObject = uploadObjectLarge(); // 60 MiB
83+
largeObjectMulti = uploadMultiPartObject(); // 60 MiB, default multipart config
8484
}
8585

8686
@AfterAll
@@ -179,13 +179,13 @@ static ObjectWithCRC uploadObjectSmall() throws IOException {
179179
return new ObjectWithCRC(name, crc32);
180180
}
181181

182-
// 80 MiB
182+
// 60 MiB
183183
static ObjectWithCRC uploadObjectLarge() throws IOException {
184184
String name = String.format("%s-%s.dat", System.currentTimeMillis(), UUID.randomUUID());
185185
LOG.info(() -> "test setup - uploading large test object: " + name);
186186
ByteArrayOutputStream os = new ByteArrayOutputStream();
187187
byte[] rand = new byte[1024 * 1024];
188-
for (int i = 0; i < 80; i++) {
188+
for (int i = 0; i < 60; i++) {
189189
new Random().nextBytes(rand);
190190
os.write(rand);
191191
}
@@ -204,12 +204,12 @@ static ObjectWithCRC uploadObjectLarge() throws IOException {
204204
return new ObjectWithCRC(name, crc32);
205205
}
206206

207-
// 80MiB, multipart default config
207+
// 60MiB, multipart default config
208208
static ObjectWithCRC uploadMultiPartObject() throws Exception {
209209
String name = String.format("%s-%s.dat", System.currentTimeMillis(), UUID.randomUUID());
210210
LOG.info(() -> "test setup - uploading large test object - multipart: " + name);
211211
ByteArrayOutputStream os = new ByteArrayOutputStream();
212-
byte[] rand = new byte[8 * 1024 * 1024];
212+
byte[] rand = new byte[6 * 1024 * 1024];
213213
for (int i = 0; i < 10; i++) {
214214
new Random().nextBytes(rand);
215215
os.write(rand);

test/s3-tests/src/it/java/software/amazon/awssdk/services/s3/regression/S3ChecksumsTestUtils.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -333,12 +333,12 @@ public static Path createRandomFile16KB() throws IOException {
333333
return tmp;
334334
}
335335

336-
public static Path createRandomFile80MB() throws IOException {
336+
public static Path createRandomFile60MB() throws IOException {
337337
Path tmp = Files.createTempFile(null, null);
338338
byte[] randomBytes = new byte[1024 * 1024];
339339
new Random().nextBytes(randomBytes);
340340
try (OutputStream os = Files.newOutputStream(tmp)) {
341-
for (int i = 0; i < 80; ++i) {
341+
for (int i = 0; i < 60; ++i) {
342342
os.write(randomBytes);
343343
}
344344
}

test/s3-tests/src/it/java/software/amazon/awssdk/services/s3/regression/UploadStreamingRegressionTesting.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public class UploadStreamingRegressionTesting extends BaseS3RegressionTest {
9393
@BeforeAll
9494
static void setupClass() throws IOException {
9595
testFileSmall = S3ChecksumsTestUtils.createRandomFile16KB();
96-
testFileLarge = S3ChecksumsTestUtils.createRandomFile80MB();
96+
testFileLarge = S3ChecksumsTestUtils.createRandomFile60MB();
9797

9898
// used in RequestBody.*buffers(...) API
9999
// we calculate crc32 once to try to accelerate test execution

0 commit comments

Comments
 (0)