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:
Andrew Gaul 2013-09-02 14:51:20 -07:00
parent e2489f3942
commit 0143a56fb5
1 changed files with 3 additions and 3 deletions

View File

@ -127,7 +127,7 @@ public class BaseBlobIntegrationTest extends BaseBlobStoreIntegrationTest {
public void testPutFileParallel() throws InterruptedException, IOException, TimeoutException {
File payloadFile = File.createTempFile("testPutFileParallel", "png");
Files.write(createTestInput(), payloadFile);
Files.write(createTestInput(32 * 1024), payloadFile);
final Payload testPayload = Payloads.newFilePayload(payloadFile);
final byte[] md5 = md5Supplier(testPayload);
@ -604,9 +604,9 @@ public class BaseBlobIntegrationTest extends BaseBlobStoreIntegrationTest {
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();
byte[] buffer = new byte[random.nextInt(2 * 1024 * 1024)];
byte[] buffer = new byte[random.nextInt(length)];
random.nextBytes(buffer);
return buffer;
}