Skip to content

Commit

Permalink
Enable ErrorProne CanonicalDuration
Browse files Browse the repository at this point in the history
  • Loading branch information
ebyhr committed Nov 8, 2024
1 parent 1135d71 commit d4f3fe9
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ private static GenericContainer<?> createAlluxioMasterContainer()
.withAccessToHost(true)
.waitingFor(new LogMessageWaitStrategy()
.withRegEx(".*Primary started*\n")
.withStartupTimeout(Duration.ofSeconds(180L)));
.withStartupTimeout(Duration.ofMinutes(3)));
return container;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ public static CassandraSession createCassandraSession(

driverConfigLoaderBuilder.withString(DefaultDriverOption.RECONNECTION_POLICY_CLASS, com.datastax.oss.driver.internal.core.connection.ExponentialReconnectionPolicy.class.getName());
driverConfigLoaderBuilder.withDuration(DefaultDriverOption.RECONNECTION_BASE_DELAY, Duration.ofMillis(500));
driverConfigLoaderBuilder.withDuration(DefaultDriverOption.RECONNECTION_MAX_DELAY, Duration.ofMillis(10_000));
driverConfigLoaderBuilder.withDuration(DefaultDriverOption.RECONNECTION_MAX_DELAY, Duration.ofSeconds(10));
driverConfigLoaderBuilder.withString(DefaultDriverOption.RETRY_POLICY_CLASS, config.getRetryPolicy().getPolicyClass().getName());

driverConfigLoaderBuilder.withString(DefaultDriverOption.LOAD_BALANCING_POLICY_CLASS, DefaultLoadBalancingPolicy.class.getName());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
import java.util.Set;

import static io.trino.spi.type.TimeZoneKey.UTC_KEY;
import static java.time.Duration.ofMillis;
import static java.time.Duration.ofSeconds;

public final class TestUtils
{
Expand Down Expand Up @@ -104,20 +104,20 @@ private TestUtils() {}
Optional.empty());

splitStatistics = new SplitStatistics(
ofMillis(1000),
ofMillis(2000),
ofMillis(3000),
ofMillis(4000),
ofSeconds(1),
ofSeconds(2),
ofSeconds(3),
ofSeconds(4),
1,
2,
Optional.of(Duration.ofMillis(100)),
Optional.of(Duration.ofMillis(200)));

queryStatistics = new QueryStatistics(
ofMillis(1000),
ofMillis(1000),
ofMillis(1000),
ofMillis(1000),
ofSeconds(1),
ofSeconds(1),
ofSeconds(1),
ofSeconds(1),
Optional.empty(),
Optional.empty(),
Optional.empty(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public MarquezServer(String version)
.withDatabaseName(POSTGRES_DB)
.withUsername(POSTGRES_USER)
.withPassword(POSTGRES_PASSWORD)
.withStartupTimeout(Duration.ofSeconds(360));
.withStartupTimeout(Duration.ofMinutes(6));

this.dockerContainerPostgres.start();
closer.register(this.dockerContainerPostgres::close);
Expand All @@ -104,7 +104,7 @@ public MarquezServer(String version)
.waitingFor(Wait.forHttp(MARQUEZ_HEALTCHECK_API)
.forPort(MARQUEZ_ADMIN_PORT)
.forStatusCode(200))
.withStartupTimeout(Duration.ofSeconds(360));
.withStartupTimeout(Duration.ofMinutes(6));

this.dockerContainerAPI.start();
closer.register(this.dockerContainerAPI::close);
Expand All @@ -115,7 +115,7 @@ public MarquezServer(String version)
.dependsOn(this.dockerContainerAPI)
.withEnv("MARQUEZ_HOST", MARQUEZ_HOST)
.withEnv("MARQUEZ_PORT", String.valueOf(MARQUEZ_PORT))
.withStartupTimeout(Duration.ofSeconds(360));
.withStartupTimeout(Duration.ofMinutes(6));
this.dockerWebUIContainerAPI.start();
closer.register(this.dockerWebUIContainerAPI::close);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,14 @@ public PrometheusServer(String version, boolean enableBasicAuth)
this.dockerContainer = new GenericContainer<>("prom/prometheus:" + version)
.withExposedPorts(PROMETHEUS_PORT)
.waitingFor(Wait.forHttp(PROMETHEUS_QUERY_API).forResponsePredicate(response -> response.contains("\"values\"")))
.withStartupTimeout(Duration.ofSeconds(360));
.withStartupTimeout(Duration.ofMinutes(6));
// Basic authentication was introduced in v2.24.0
if (enableBasicAuth) {
this.dockerContainer
.withCommand("--config.file=/etc/prometheus/prometheus.yml", "--web.config.file=/etc/prometheus/web.yml")
.withCopyFileToContainer(forClasspathResource("web.yml"), "/etc/prometheus/web.yml")
.waitingFor(Wait.forHttp(PROMETHEUS_QUERY_API).forResponsePredicate(response -> response.contains("\"values\"")).withBasicCredentials(USER, PASSWORD))
.withStartupTimeout(Duration.ofSeconds(360));
.withStartupTimeout(Duration.ofMinutes(6));
}
this.dockerContainer.start();
}
Expand Down
1 change: 1 addition & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2818,6 +2818,7 @@
-Xep:BoxedPrimitiveConstructor:ERROR \
-Xep:ByteBufferBackingArray:ERROR \
-Xep:CacheLoaderNull:ERROR \
-Xep:CanonicalDuration:ERROR \
-Xep:CatchAndPrintStackTrace:ERROR \
-Xep:CatchFail:ERROR \
-Xep:ClassCanBeStatic:ERROR \
Expand Down

0 comments on commit d4f3fe9

Please sign in to comment.