Skip to content

Commit 62ad248

Browse files
committed
Fix flaky concurrent compression test with proper synchronization.
1 parent f57a2a1 commit 62ad248

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/test/java/com/rbatllet/blockchain/maintenance/OffChainCleanupServiceTest.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1281,6 +1281,16 @@ void testConcurrentCompressionOperations() throws Exception {
12811281
);
12821282
executor.shutdown();
12831283

1284+
// Additional wait for file system operations to complete
1285+
// File I/O and compression can take additional time even after threads complete
1286+
assertTrue(
1287+
executor.awaitTermination(30, TimeUnit.SECONDS),
1288+
"Executor should terminate after completion"
1289+
);
1290+
1291+
// Additional buffer time for file system write operations
1292+
Thread.sleep(2000);
1293+
12841294
// Verify no exceptions
12851295
if (!exceptions.isEmpty()) {
12861296
fail(

0 commit comments

Comments
 (0)