Skip to content

Commit

Permalink
Work around more flaky tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
io7m committed Sep 29, 2024
1 parent eb60707 commit 4c37310
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
import java.nio.file.Path;
import java.util.HashMap;
import java.util.List;
import java.util.Objects;
import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
Expand Down Expand Up @@ -71,8 +70,13 @@ public void setup(

@AfterEach
public void tearDown()
throws InterruptedException
{
/*
* A delay to give Windows time to cope with the SQLite database being closed.
*/

Thread.sleep(1_000L);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import com.io7m.laurel.gui.internal.LPerpetualSubscriber;
import com.io7m.laurel.model.LException;
import com.io7m.laurel.model.LImageWithID;
import com.io7m.zelador.test_extension.CloseableResourcesType;
import com.io7m.zelador.test_extension.ZeladorExtension;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
Expand Down Expand Up @@ -62,8 +61,7 @@ public final class LFileModelImportTest

@BeforeEach
public void setup(
final @TempDir Path directory,
final CloseableResourcesType resources)
final @TempDir Path directory)
{
this.directory = directory;
this.outputFile = directory.resolve("out.db");
Expand All @@ -72,8 +70,13 @@ public void setup(

@AfterEach
public void tearDown()
throws InterruptedException
{
/*
* A delay to give Windows time to cope with the SQLite database being closed.
*/

Thread.sleep(1_000L);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,10 @@ public void tearDown()
{
this.model.close();

/*
* A delay to give Windows time to cope with the SQLite database being closed.
*/

Thread.sleep(1_000L);
}

Expand Down

0 comments on commit 4c37310

Please sign in to comment.