diff --git a/server/src/test/java/org/elasticsearch/index/shard/IndexShardTests.java b/server/src/test/java/org/elasticsearch/index/shard/IndexShardTests.java index 1a2e53628de61..bacf36f955c44 100644 --- a/server/src/test/java/org/elasticsearch/index/shard/IndexShardTests.java +++ b/server/src/test/java/org/elasticsearch/index/shard/IndexShardTests.java @@ -3557,6 +3557,9 @@ public void testSegmentMemoryTrackedInBreaker() throws Exception { // In order to instruct the merge policy not to keep a fully deleted segment, // we need to flush and make that commit safe so that the SoftDeletesPolicy can drop everything. if (IndexSettings.INDEX_SOFT_DELETES_SETTING.get(settings)) { + primary.updateGlobalCheckpointForShard( + primary.routingEntry().allocationId().getId(), + primary.getLastSyncedGlobalCheckpoint()); primary.advancePeerRecoveryRetentionLeasesToGlobalCheckpoints(); primary.sync(); flushShard(primary);