|
40 | 40 | import com.datastax.oss.driver.internal.core.session.BuiltInRequestProcessors; |
41 | 41 | import com.datastax.oss.driver.internal.core.session.RequestProcessor; |
42 | 42 | import com.datastax.oss.driver.internal.core.session.RequestProcessorRegistry; |
| 43 | +import com.datastax.oss.driver.shaded.guava.common.cache.CacheBuilder; |
43 | 44 | import com.datastax.oss.driver.shaded.guava.common.cache.RemovalListener; |
44 | 45 | import com.datastax.oss.driver.shaded.guava.common.util.concurrent.Uninterruptibles; |
45 | 46 | import com.google.common.collect.ImmutableList; |
@@ -135,7 +136,9 @@ private static RemovalListener<Object, Object> buildCacheRemoveCallback( |
135 | 136 | public TestCqlPrepareAsyncProcessor(@NonNull Optional<DefaultDriverContext> context) { |
136 | 137 | // Default CqlPrepareAsyncProcessor uses weak values here as well. We avoid doing so |
137 | 138 | // to prevent cache entries from unexpectedly disappearing mid-test. |
138 | | - super(context, builder -> builder.removalListener(buildCacheRemoveCallback(context))); |
| 139 | + super( |
| 140 | + context, |
| 141 | + builder -> CacheBuilder.newBuilder().removalListener(buildCacheRemoveCallback(context))); |
139 | 142 | } |
140 | 143 | } |
141 | 144 |
|
@@ -267,14 +270,14 @@ private void invalidationTestInner( |
267 | 270 | session.execute("ALTER TYPE test_type_2 add i blob"); |
268 | 271 |
|
269 | 272 | // wait for latches and fail if they don't reach zero before timeout |
| 273 | + assertThat(Uninterruptibles.awaitUninterruptibly(typeChangeEventLatch, 10, TimeUnit.SECONDS)) |
| 274 | + .withFailMessage("typeChangeEventLatch did not trigger before timeout") |
| 275 | + .isTrue(); |
270 | 276 | assertThat( |
271 | 277 | Uninterruptibles.awaitUninterruptibly( |
272 | 278 | preparedStmtCacheRemoveLatch, 10, TimeUnit.SECONDS)) |
273 | 279 | .withFailMessage("preparedStmtCacheRemoveLatch did not trigger before timeout") |
274 | 280 | .isTrue(); |
275 | | - assertThat(Uninterruptibles.awaitUninterruptibly(typeChangeEventLatch, 10, TimeUnit.SECONDS)) |
276 | | - .withFailMessage("typeChangeEventLatch did not trigger before timeout") |
277 | | - .isTrue(); |
278 | 281 |
|
279 | 282 | /* Okay, the latch triggered so cache processing should now be done. Let's validate :allthethings: */ |
280 | 283 | assertThat(changedTypes.keySet()).isEqualTo(expectedChangedTypes); |
|
0 commit comments