-
Notifications
You must be signed in to change notification settings - Fork 25.8k
Fix flaky testWriteLargeBlob in AzureBlobContainerRetriesTests #145748
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
dc2312c
5acc548
8f87bb1
eab07dc
8dcd429
6d62690
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -352,7 +352,7 @@ public void testWriteBlobWithRetries() throws Exception { | |
| } | ||
|
|
||
| public void testWriteLargeBlob() throws Exception { | ||
| final int maxRetries = randomIntBetween(2, 5); | ||
| final int maxRetries = randomIntBetween(4, 8); | ||
| logger.info("--> max retries: {}", maxRetries); | ||
|
|
||
| final byte[] data = randomBytes(ByteSizeUnit.MB.toIntBytes(10) + randomIntBetween(0, ByteSizeUnit.MB.toIntBytes(1))); | ||
|
|
@@ -427,7 +427,6 @@ public void testWriteLargeBlob() throws Exception { | |
| try (InputStream stream = new InputStreamIndexInput(new ByteArrayIndexInput("desc", data), data.length)) { | ||
| blobContainer.writeBlob(randomPurpose(), "write_large_blob", stream, data.length, false); | ||
| } | ||
|
|
||
| assertThat(countDownUploads.get(), equalTo(0)); | ||
| assertThat(countDownComplete.isCountedDown(), is(true)); | ||
| assertThat(blocks.isEmpty(), is(true)); | ||
|
|
@@ -669,11 +668,11 @@ public void testRetriesAreTerminatedWhenClientProviderIsClosed() { | |
| } | ||
|
|
||
| private BlobContainer createBlobContainer(int maxRetries, String secondaryHost, LocationMode locationMode) { | ||
| return createBlobContainer(maxRetries, null, null, null, null, null, BlobPath.EMPTY, secondaryHost, locationMode); | ||
| return createBlobContainer(maxRetries, null, null, null, null, null, null, BlobPath.EMPTY, secondaryHost, locationMode); | ||
| } | ||
|
|
||
| private BlobContainer createBlobContainer(int maxRetries) { | ||
| return createBlobContainer(maxRetries, null, null, null, null, null, null); | ||
| return createBlobContainer(maxRetries, null, null, null, null, null, null, null); | ||
| } | ||
|
|
||
| @Override | ||
|
|
@@ -694,17 +693,19 @@ protected Class<? extends Exception> unresponsiveExceptionType() { | |
|
|
||
| @Override | ||
| protected BlobContainer createBlobContainer( | ||
| @Nullable Integer maxRetries, | ||
| @Nullable TimeValue readTimeout, | ||
| @Nullable Boolean disableChunkedEncoding, | ||
| @Nullable Integer maxConnections, | ||
| @Nullable ByteSizeValue bufferSize, | ||
| @Nullable Integer maxBulkDeletes, | ||
| @Nullable BlobPath blobContainerPath | ||
| final @Nullable Integer maxRetries, | ||
| final @Nullable TimeValue readTimeout, | ||
| final @Nullable TimeValue requestTimeout, | ||
| final @Nullable Boolean disableChunkedEncoding, | ||
| final @Nullable Integer maxConnections, | ||
| final @Nullable ByteSizeValue bufferSize, | ||
| final @Nullable Integer maxBulkDeletes, | ||
| final @Nullable BlobPath blobContainerPath | ||
| ) { | ||
| return createBlobContainer( | ||
| maxRetries, | ||
| readTimeout, | ||
| requestTimeout, | ||
| disableChunkedEncoding, | ||
| maxConnections, | ||
| bufferSize, | ||
|
|
@@ -718,6 +719,7 @@ protected BlobContainer createBlobContainer( | |
| private BlobContainer createBlobContainer( | ||
| @Nullable Integer maxRetries, | ||
| @Nullable TimeValue readTimeout, | ||
| @Nullable TimeValue timeout, | ||
| @Nullable Boolean disableChunkedEncoding, | ||
| @Nullable Integer maxConnections, | ||
| @Nullable ByteSizeValue bufferSize, | ||
|
|
@@ -742,7 +744,11 @@ private BlobContainer createBlobContainer( | |
| if (maxRetries != null) { | ||
| clientSettings.put(MAX_RETRIES_SETTING.getConcreteSettingForNamespace(clientName).getKey(), maxRetries); | ||
| } | ||
| clientSettings.put(TIMEOUT_SETTING.getConcreteSettingForNamespace(clientName).getKey(), TimeValue.timeValueSeconds(1)); | ||
| if (timeout != null) { | ||
| clientSettings.put(TIMEOUT_SETTING.getConcreteSettingForNamespace(clientName).getKey(), timeout); | ||
| } else { | ||
| clientSettings.put(TIMEOUT_SETTING.getConcreteSettingForNamespace(clientName).getKey(), SAFE_AWAIT_TIMEOUT); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this ok for the timeout-related tests or does it slow them down too far?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes before this change |
||
| } | ||
| if (readTimeout != null) { | ||
| clientSettings.put(READ_TIMEOUT_SETTING.getConcreteSettingForNamespace(clientName).getKey(), readTimeout); | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this ever not null?