Skip to content

Commit c91bc87

Browse files
committed
Reword some comments
1 parent 074d280 commit c91bc87

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

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

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -563,17 +563,15 @@ public void testHitsMissesAndEvictionsStats() throws Exception {
563563
final Query query2 = QueryBuilders.termQuery("field-2", "value-2").toQuery(searchExecutionContext);
564564
final BitSet bitSet2 = cache.getBitSet(query2, leafContext);
565565
assertThat(bitSet2, notNullValue());
566-
// eviction callback calls `get` on the cache, asynchronously, which updates the stats.
567-
// so assertion is current state of the code, rather than the expected state.
568-
// issue: https://github.com/elastic/elasticsearch/issues/132842
566+
// surprisingly, the eviction callback can call `get` on the cache (asynchronously) which causes another miss (or hit)
567+
// so this assertion is about the current state of the code, rather than the expected or desired state.
568+
// see https://github.com/elastic/elasticsearch/issues/132842
569569
expectedStats.put("misses", 3L);
570570
expectedStats.put("evictions", 1L);
571571
assertBusy(() -> { assertThat(cache.usageStats(), equalTo(expectedStats)); }, 200, TimeUnit.MILLISECONDS);
572572
});
573573

574574
final Map<String, Object> finalStats = emptyStatsSupplier.get();
575-
// related to comment above: surprisingly last eviction doesn't increment hits nor misses, because it goes through onClose(),
576-
// and short-circuits in the eviction callback before doing a `get`.
577575
finalStats.put("hits", 1L);
578576
finalStats.put("misses", 3L);
579577
finalStats.put("evictions", 2L);

0 commit comments

Comments
 (0)