mirror of
https://github.com/apache/jclouds.git
synced 2025-02-09 11:35:41 +00:00
Reduce testPutFileParallel input size to ~160 KB
Previously this test uploaded ~10 MB in 30 seconds which failed on slower connections, causing spurious test failures. The larger input size provides no benefit.
This commit is contained in:
parent
b80bb48be3
commit
e27ae6117c
@ -134,7 +134,7 @@ public class BaseBlobIntegrationTest extends BaseBlobStoreIntegrationTest {
|
|||||||
public void testPutFileParallel() throws InterruptedException, IOException, TimeoutException {
|
public void testPutFileParallel() throws InterruptedException, IOException, TimeoutException {
|
||||||
|
|
||||||
File payloadFile = File.createTempFile("testPutFileParallel", "png");
|
File payloadFile = File.createTempFile("testPutFileParallel", "png");
|
||||||
Files.write(createTestInput(), payloadFile);
|
Files.write(createTestInput(32 * 1024), payloadFile);
|
||||||
|
|
||||||
final Payload testPayload = Payloads.newFilePayload(payloadFile);
|
final Payload testPayload = Payloads.newFilePayload(payloadFile);
|
||||||
final byte[] md5 = md5Supplier(testPayload);
|
final byte[] md5 = md5Supplier(testPayload);
|
||||||
@ -611,9 +611,9 @@ public class BaseBlobIntegrationTest extends BaseBlobStoreIntegrationTest {
|
|||||||
assertEquals(metadata.getContentMetadata().getContentMD5(), md5().hashString(TEST_STRING, UTF_8).asBytes());
|
assertEquals(metadata.getContentMetadata().getContentMD5(), md5().hashString(TEST_STRING, UTF_8).asBytes());
|
||||||
}
|
}
|
||||||
|
|
||||||
private byte[] createTestInput() throws IOException {
|
private static byte[] createTestInput(int length) throws IOException {
|
||||||
Random random = new Random();
|
Random random = new Random();
|
||||||
byte[] buffer = new byte[random.nextInt(2 * 1024 * 1024)];
|
byte[] buffer = new byte[random.nextInt(length)];
|
||||||
random.nextBytes(buffer);
|
random.nextBytes(buffer);
|
||||||
return buffer;
|
return buffer;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user