Skip to content

Commit

Permalink
Re-enable testScheduleCleanup_WithScheduledExecutor_UsingMultipleConc…
Browse files Browse the repository at this point in the history
…urrentCleaners_IntegrationTest on all platforms

The concurrent cleaners need to be created with a small buffer in between.  See #143 for details

Fixes #143
  • Loading branch information
chrisrohr committed Apr 21, 2021
1 parent bb6ab25 commit 0c9ac15
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,10 @@
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.EnabledOnOs;
import org.junit.jupiter.api.condition.OS;
import org.junit.jupiter.api.io.TempDir;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.ValueSource;
import org.kiwiproject.base.DefaultEnvironment;
import org.kiwiproject.dropwizard.metrics.health.TimeBasedDirectoryCleanerHealthCheck;
import org.kiwiproject.io.TimeBasedDirectoryCleaner;
import org.kiwiproject.io.TimeBasedDirectoryCleanerTestHelper;
Expand Down Expand Up @@ -136,7 +135,6 @@ private void shutdownAndAwaitTermination(ScheduledExecutorService executorServic
*/
@ParameterizedTest
@ValueSource(ints = { 500, 2000 })
@EnabledOnOs(OS.LINUX)
void testScheduleCleanup_WithScheduledExecutor_UsingMultipleConcurrentCleaners_IntegrationTest(int totalFileCount) throws InterruptedException {
assertThat(TimeBasedDirectoryCleaner.capacityOfRecentDeleteErrors())
.describedAs("Assumption of cleaner error queue capacity of 500 is invalid; @ValueSource values need to be adjusted")
Expand All @@ -155,6 +153,7 @@ void testScheduleCleanup_WithScheduledExecutor_UsingMultipleConcurrentCleaners_I
testHelper.createDirectoriesWithFiles(1, 100);

var cleaner1 = cleanerConfig.scheduleCleanupUsing(executorService1);
new DefaultEnvironment().sleepQuietly(400);
var cleaner2 = cleanerConfig.scheduleCleanupUsing(executorService2);

testHelper.createDirectoriesWithFiles(101, 200);
Expand Down

0 comments on commit 0c9ac15

Please sign in to comment.