diff --git a/integration-tests/src/test/java/com/datastax/oss/driver/core/cql/PreparedStatementCachingIT.java b/integration-tests/src/test/java/com/datastax/oss/driver/core/cql/PreparedStatementCachingIT.java index 617d489fb95..83163cfedfb 100644 --- a/integration-tests/src/test/java/com/datastax/oss/driver/core/cql/PreparedStatementCachingIT.java +++ b/integration-tests/src/test/java/com/datastax/oss/driver/core/cql/PreparedStatementCachingIT.java @@ -40,6 +40,7 @@ import com.datastax.oss.driver.internal.core.session.BuiltInRequestProcessors; import com.datastax.oss.driver.internal.core.session.RequestProcessor; import com.datastax.oss.driver.internal.core.session.RequestProcessorRegistry; +import com.datastax.oss.driver.shaded.guava.common.cache.CacheBuilder; import com.datastax.oss.driver.shaded.guava.common.cache.RemovalListener; import com.datastax.oss.driver.shaded.guava.common.util.concurrent.Uninterruptibles; import com.google.common.collect.ImmutableList; @@ -135,7 +136,9 @@ private static RemovalListener buildCacheRemoveCallback( public TestCqlPrepareAsyncProcessor(@NonNull Optional context) { // Default CqlPrepareAsyncProcessor uses weak values here as well. We avoid doing so // to prevent cache entries from unexpectedly disappearing mid-test. - super(context, builder -> builder.removalListener(buildCacheRemoveCallback(context))); + super( + context, + builder -> CacheBuilder.newBuilder().removalListener(buildCacheRemoveCallback(context))); } } @@ -267,14 +270,14 @@ private void invalidationTestInner( session.execute("ALTER TYPE test_type_2 add i blob"); // wait for latches and fail if they don't reach zero before timeout + assertThat(Uninterruptibles.awaitUninterruptibly(typeChangeEventLatch, 10, TimeUnit.SECONDS)) + .withFailMessage("typeChangeEventLatch did not trigger before timeout") + .isTrue(); assertThat( Uninterruptibles.awaitUninterruptibly( preparedStmtCacheRemoveLatch, 10, TimeUnit.SECONDS)) .withFailMessage("preparedStmtCacheRemoveLatch did not trigger before timeout") .isTrue(); - assertThat(Uninterruptibles.awaitUninterruptibly(typeChangeEventLatch, 10, TimeUnit.SECONDS)) - .withFailMessage("typeChangeEventLatch did not trigger before timeout") - .isTrue(); /* Okay, the latch triggered so cache processing should now be done. Let's validate :allthethings: */ assertThat(changedTypes.keySet()).isEqualTo(expectedChangedTypes);