dlmarion commented on code in PR #3982:
URL: https://github.com/apache/accumulo/pull/3982#discussion_r1406237720
##########
core/src/test/java/org/apache/accumulo/core/data/NamespaceIdTest.java:
##########
@@ -37,22 +39,17 @@ public class NamespaceIdTest extends WithTestNames {
private static final Logger LOG =
LoggerFactory.getLogger(NamespaceIdTest.class);
- private static long cacheCount() {
- // guava cache size() is approximate, and can include garbage-collected
entries
- // so we iterate to get the actual cache size
- return NamespaceId.cache.asMap().entrySet().stream().count();
- }
-
@Test
public void testCacheNoDuplicates() {
// the next line just preloads the built-ins, since they now exist in a
separate class from
// NamespaceId, and aren't preloaded when the NamespaceId class is
referenced
assertNotSame(Namespace.ACCUMULO.id(), Namespace.DEFAULT.id());
String namespaceString = "namespace-" + testName();
- long initialSize = cacheCount();
+ long initialSize = cacheCount(NamespaceId.cache);
NamespaceId nsId = NamespaceId.of(namespaceString);
- assertEquals(initialSize + 1, cacheCount());
+ assertCacheCountEquals(initialSize + 1, NamespaceId.cache);
Review Comment:
> The Wait.waitFor does not have junit / test dependencies, so relocating it
to core should not be an issue. Was just not sure we wanted to do that.
We could just add the Wait class methods to the UtilWaitThread class...
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]