From 4a97c86f6061a144b4d991d26faae447d3378534 Mon Sep 17 00:00:00 2001 From: rishabhdaim Date: Fri, 6 Nov 2026 08:17:47 +0530 Subject: [PATCH] OAK-12513 : remove background write race in incremental store test Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../org/apache/jackrabbit/oak/index/IncrementalStoreTest.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/oak-run/src/test/java/org/apache/jackrabbit/oak/index/IncrementalStoreTest.java b/oak-run/src/test/java/org/apache/jackrabbit/oak/index/IncrementalStoreTest.java index 0048281d029..a0db76f6c79 100644 --- a/oak-run/src/test/java/org/apache/jackrabbit/oak/index/IncrementalStoreTest.java +++ b/oak-run/src/test/java/org/apache/jackrabbit/oak/index/IncrementalStoreTest.java @@ -219,6 +219,7 @@ public void testWithLz4CompressionWithCustomRegexFilterAndCustomExcludedPaths() public void incrementalFFSTest(boolean customRegexFilter, boolean customExcludedPathsFilter) throws Exception { Backend rwBackend = createNodeStore(false); createBaseContent(rwBackend.documentNodeStore); + rwBackend.documentNodeStore.runBackgroundOperations(); String initialCheckpoint = rwBackend.documentNodeStore.checkpoint(3600000); Backend roBackend = createNodeStore(true); @@ -228,6 +229,7 @@ public void incrementalFFSTest(boolean customRegexFilter, boolean customExcluded Path initialFfsPath = createFFS(roBackend, pathPredicate, basePreferredPathElements, List.of(new PathFilter(List.of("/"), Collections.emptyList())), initialCheckpoint, "initial", getNodeStateAtCheckpoint1(customRegexFilter, customExcludedPathsFilter)); createIncrementalContent(rwBackend.documentNodeStore); + rwBackend.documentNodeStore.runBackgroundOperations(); String finalCheckpoint = rwBackend.documentNodeStore.checkpoint(3600000); Backend roBackend1 = createNodeStore(true); @@ -731,7 +733,7 @@ private Backend createNodeStore(boolean readOnly) { if (readOnly) { builder.setReadOnlyMode(); } - builder.setAsyncDelay(1); + builder.setAsyncDelay(0); DocumentNodeStore documentNodeStore = builder.getNodeStore(); BlobStore blobStore = new MemoryBlobStore(); return new Backend(c.getMongoURI(), (MongoDocumentStore) builder.getDocumentStore(), documentNodeStore, c.getDatabase(), blobStore);