Skip to content

Commit 2fe947e

Browse files
committed
Make this test work again
1 parent 5913a0f commit 2fe947e

File tree

1 file changed

+0
-19
lines changed

1 file changed

+0
-19
lines changed

x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/authz/accesscontrol/DocumentSubsetBitsetCacheTests.java

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -272,22 +272,13 @@ public void testCacheRespectsAccessTimeExpiry() throws Exception {
272272
});
273273
}
274274

275-
@AwaitsFix(bugUrl = "todo")
276275
public void testIndexLookupIsClearedWhenBitSetIsEvicted() throws Exception {
277276
// Enough to hold slightly more than 1 bit-set in the cache
278277
final long maxCacheBytes = EXPECTED_BYTES_PER_BIT_SET + EXPECTED_BYTES_PER_BIT_SET / 2;
279278
final Settings settings = Settings.builder()
280279
.put(DocumentSubsetBitsetCache.CACHE_SIZE_SETTING.getKey(), maxCacheBytes + "b")
281280
.build();
282281

283-
final ExecutorService executor = mock(ExecutorService.class);
284-
final AtomicReference<Runnable> runnableRef = new AtomicReference<>();
285-
when(executor.submit(any(Runnable.class))).thenAnswer(inv -> {
286-
final Runnable r = (Runnable) inv.getArguments()[0];
287-
runnableRef.set(r);
288-
return null;
289-
});
290-
291282
final DocumentSubsetBitsetCache cache = new DocumentSubsetBitsetCache(settings);
292283
assertThat(cache.entryCount(), equalTo(0));
293284
assertThat(cache.ramBytesUsed(), equalTo(0L));
@@ -300,20 +291,10 @@ public void testIndexLookupIsClearedWhenBitSetIsEvicted() throws Exception {
300291
final Query query2 = QueryBuilders.termQuery("field-2", "value-2").toQuery(searchExecutionContext);
301292
final BitSet bitSet2 = cache.getBitSet(query2, leafContext);
302293
assertThat(bitSet2, notNullValue());
303-
304-
// BitSet1 has been evicted now, run the cleanup...
305-
final Runnable runnable1 = runnableRef.get();
306-
assertThat(runnable1, notNullValue());
307-
runnable1.run();
308294
cache.verifyInternalConsistency();
309295

310296
// Check that the original bitset is no longer in the cache (a new instance is returned)
311297
assertThat(cache.getBitSet(query1, leafContext), not(sameInstance(bitSet1)));
312-
313-
// BitSet2 has been evicted now, run the cleanup...
314-
final Runnable runnable2 = runnableRef.get();
315-
assertThat(runnable2, not(sameInstance(runnable1)));
316-
runnable2.run();
317298
cache.verifyInternalConsistency();
318299
});
319300
}

0 commit comments

Comments
 (0)