mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-03-22 06:50:54 +07:00
[artifact-repository-manager] RetryProvider: do not log retry limit exceeded exception as err, use warn instead
Otherwise, some tests behaviour may change by an error thrown from logger: `com.intellij.testFramework.TestLoggerFactory$TestLoggerAssertionError: Retry attempts limit exceeded` GitOrigin-RevId: c167353951d0d263bb5a457727eb6ba18999f204
This commit is contained in:
committed by
intellij-monorepo-bot
parent
ee2be25e7a
commit
0e71c30b2e
@@ -85,7 +85,7 @@ public final class RetryProvider {
|
||||
}
|
||||
catch (Exception e) {
|
||||
if (i == maxAttempts) {
|
||||
logger.error("Retry attempts limit exceeded, tried " + maxAttempts + " times. Cause: " + e.getMessage(), e);
|
||||
logger.warn("Retry attempts limit exceeded, tried " + maxAttempts + " times. Cause: " + e.getMessage(), e);
|
||||
throw e;
|
||||
}
|
||||
logger.warn("Attempt " + i + " of " + maxAttempts + " failed, retrying in " + effectiveDelay + "ms. Cause: " + e.getMessage(), e);
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
package org.jetbrains.idea.maven.aether;
|
||||
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.testFramework.LoggedErrorProcessor;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.jetbrains.idea.maven.aether.RetryProvider.disabled;
|
||||
@@ -60,7 +59,7 @@ class RetryProviderTest {
|
||||
|
||||
@Test
|
||||
public void expBackOff_testRetry() throws Exception {
|
||||
int attempts = retryWithExpBackOff.retry(new ThrowingSupplier<Integer>() {
|
||||
int attempts = retryWithExpBackOff.retry(new ThrowingSupplier<>() {
|
||||
private int attempts = 0;
|
||||
|
||||
@Override
|
||||
@@ -88,14 +87,9 @@ class RetryProviderTest {
|
||||
|
||||
@Test
|
||||
public void expBackOff_testRethrowsException() {
|
||||
Throwable error = LoggedErrorProcessor.executeAndReturnLoggedError(
|
||||
() -> {
|
||||
String expected = "Value42";
|
||||
assertThrows(Exception.class, () -> retryWithExpBackOff.retry(() -> {
|
||||
throw new Exception(expected);
|
||||
}, logger), expected);
|
||||
});
|
||||
|
||||
assertNotNull(error);
|
||||
String expected = "Value42";
|
||||
assertThrows(Exception.class, () -> retryWithExpBackOff.retry(() -> {
|
||||
throw new Exception(expected);
|
||||
}, logger), expected);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user