From 1a91846e7ba3f6cd9d091c3e5516048a9e0a229a Mon Sep 17 00:00:00 2001 From: Stefan Egli Date: Wed, 6 Nov 2024 14:28:08 +0100 Subject: [PATCH] OAK-11254 : added sleep after creation of DocumentNodeStore to reduce likelyhood of backgroundPurge to interfere with testing and clean up branch commits on root --- .../oak/plugins/document/BranchCommitGCTest.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/BranchCommitGCTest.java b/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/BranchCommitGCTest.java index 318610494ab..c0f88c02c6b 100644 --- a/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/BranchCommitGCTest.java +++ b/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/BranchCommitGCTest.java @@ -759,7 +759,15 @@ private DocumentNodeStore newStore(int clusterId) { if (clusterId > 0) { builder.setClusterId(clusterId); } - return builder.getNodeStore(); + DocumentNodeStore nodeStore = builder.getNodeStore(); + // OAK-11254 : adding a temporary sleep to reduce likelyhood of + // backgroundPurge to interfere with test + try { + Thread.sleep(1000); + } catch (InterruptedException e) { + fail("got interrupted"); + } + return nodeStore; } private RevisionVector mergedBranchCommit(Consumer buildFunction) throws Exception {