Skip to content

Commit 86b2ece

Browse files
liuguoqingfzandrross
authored andcommitted
Fix a flaky test that forces materialization to hit cache
Signed-off-by: Joe Liu <[email protected]>
1 parent cb9c30b commit 86b2ece

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

server/src/test/java/org/opensearch/index/fielddata/IndexFieldDataServiceTests.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,10 @@ public void onRemoval(ShardId shardId, String fieldName, boolean wasEvicted, lon
185185
LeafFieldData loadField1 = ifd1.load(leafReaderContext);
186186
LeafFieldData loadField2 = ifd2.load(leafReaderContext);
187187

188+
// Force materialization so both hit the shared cache
189+
loadField1.getBytesValues();
190+
loadField2.getBytesValues();
191+
188192
assertEquals(2, indicesService.getIndicesFieldDataCache().getCache().count());
189193

190194
// Remove index

0 commit comments

Comments
 (0)