You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by ct...@apache.org on 2022/02/24 04:38:55 UTC
[accumulo] branch main updated: Change timeouts to correct unit (#2521)
This is an automated email from the ASF dual-hosted git repository.
ctubbsii pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/accumulo.git
The following commit(s) were added to refs/heads/main by this push:
new 6fcf9c6 Change timeouts to correct unit (#2521)
6fcf9c6 is described below
commit 6fcf9c6a76e5bba6e3ac14cc0ebb30fc9531222e
Author: Dom G <do...@gmail.com>
AuthorDate: Wed Feb 23 23:38:48 2022 -0500
Change timeouts to correct unit (#2521)
---
.../test/java/org/apache/accumulo/core/data/NamespaceIdTest.java | 2 +-
core/src/test/java/org/apache/accumulo/core/data/TableIdTest.java | 2 +-
.../apache/accumulo/core/file/rfile/bcfile/CompressionTest.java | 6 +++---
.../src/test/java/org/apache/accumulo/core/util/InternerTest.java | 2 +-
.../java/org/apache/accumulo/fate/zookeeper/ZooSessionTest.java | 8 +++++---
5 files changed, 11 insertions(+), 9 deletions(-)
diff --git a/core/src/test/java/org/apache/accumulo/core/data/NamespaceIdTest.java b/core/src/test/java/org/apache/accumulo/core/data/NamespaceIdTest.java
index 73fc653..fbbbfb4 100644
--- a/core/src/test/java/org/apache/accumulo/core/data/NamespaceIdTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/data/NamespaceIdTest.java
@@ -69,7 +69,7 @@ public class NamespaceIdTest extends WithTestNames {
}
@Test
- @Timeout(30_000)
+ @Timeout(30)
public void testCacheIncreasesAndDecreasesAfterGC() {
long initialSize = cacheCount();
assertTrue(initialSize < 20); // verify initial amount is reasonably low
diff --git a/core/src/test/java/org/apache/accumulo/core/data/TableIdTest.java b/core/src/test/java/org/apache/accumulo/core/data/TableIdTest.java
index 16810ae..bcf6c88 100644
--- a/core/src/test/java/org/apache/accumulo/core/data/TableIdTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/data/TableIdTest.java
@@ -81,7 +81,7 @@ public class TableIdTest extends WithTestNames {
}
@Test
- @Timeout(30_000)
+ @Timeout(30)
public void testCacheIncreasesAndDecreasesAfterGC() {
long initialSize = cacheCount();
assertTrue(initialSize < 20); // verify initial amount is reasonably low
diff --git a/core/src/test/java/org/apache/accumulo/core/file/rfile/bcfile/CompressionTest.java b/core/src/test/java/org/apache/accumulo/core/file/rfile/bcfile/CompressionTest.java
index d9757a1..518e878 100644
--- a/core/src/test/java/org/apache/accumulo/core/file/rfile/bcfile/CompressionTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/file/rfile/bcfile/CompressionTest.java
@@ -159,7 +159,7 @@ public class CompressionTest {
}
@Test
- @Timeout(60_000)
+ @Timeout(60)
public void testManyStartNotNull() throws InterruptedException, ExecutionException {
for (final Algorithm al : Algorithm.values()) {
@@ -202,7 +202,7 @@ public class CompressionTest {
// don't start until we have created the codec
@Test
- @Timeout(60_000)
+ @Timeout(60)
public void testManyDontStartUntilThread() throws InterruptedException, ExecutionException {
for (final Algorithm al : Algorithm.values()) {
@@ -239,7 +239,7 @@ public class CompressionTest {
}
@Test
- @Timeout(60_000)
+ @Timeout(60)
public void testThereCanBeOnlyOne() throws InterruptedException, ExecutionException {
for (final Algorithm al : Algorithm.values()) {
diff --git a/core/src/test/java/org/apache/accumulo/core/util/InternerTest.java b/core/src/test/java/org/apache/accumulo/core/util/InternerTest.java
index 7e2d759..801b972 100644
--- a/core/src/test/java/org/apache/accumulo/core/util/InternerTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/util/InternerTest.java
@@ -81,7 +81,7 @@ public class InternerTest {
}
@Test
- @Timeout(20_000)
+ @Timeout(20)
public void testInternsGetGarbageCollected() {
var interner = new Interner<TestObj>();
assertEquals(0, interner.size()); // ensure empty
diff --git a/core/src/test/java/org/apache/accumulo/fate/zookeeper/ZooSessionTest.java b/core/src/test/java/org/apache/accumulo/fate/zookeeper/ZooSessionTest.java
index f0ce3a2..eabb217 100644
--- a/core/src/test/java/org/apache/accumulo/fate/zookeeper/ZooSessionTest.java
+++ b/core/src/test/java/org/apache/accumulo/fate/zookeeper/ZooSessionTest.java
@@ -18,6 +18,7 @@
*/
package org.apache.accumulo.fate.zookeeper;
+import static java.util.concurrent.TimeUnit.SECONDS;
import static org.junit.jupiter.api.Assertions.assertThrows;
import org.apache.zookeeper.ZooKeeper;
@@ -26,14 +27,15 @@ import org.junit.jupiter.api.Timeout;
public class ZooSessionTest {
- private static final int MINIMUM_TIMEOUT = 10000;
+ private static final int TIMEOUT_SECONDS = 10;
private static final String UNKNOWN_HOST = "hostname.that.should.not.exist.example.com:2181";
@Test
- @Timeout(MINIMUM_TIMEOUT * 4)
+ @Timeout(TIMEOUT_SECONDS * 4)
public void testUnknownHost() {
assertThrows(RuntimeException.class, () -> {
- ZooKeeper session = ZooSession.connect(UNKNOWN_HOST, MINIMUM_TIMEOUT, null, null, null);
+ ZooKeeper session = ZooSession.connect(UNKNOWN_HOST, (int) SECONDS.toMillis(TIMEOUT_SECONDS),
+ null, null, null);
session.close();
});
}