Skip to content

Commit 2cc3c66

Browse files
committed
Remove trySleep helpers
1 parent 76ec380 commit 2cc3c66

File tree

2 files changed

+2
-14
lines changed

2 files changed

+2
-14
lines changed

src/test/java/engineering/swat/watch/RecursiveWatchTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ void deleteOfFileInDirectoryShouldBeVisible() throws IOException {
150150

151151
@ParameterizedTest
152152
@EnumSource // Repeat test for each `OnOverflow` value
153-
void overflowsAreRecoveredFrom(OnOverflow whichFiles) throws IOException {
153+
void overflowsAreRecoveredFrom(OnOverflow whichFiles) throws IOException, InterruptedException {
154154
var parent = testDir.getTestDirectory();
155155
var descendants = new Path[] {
156156
Path.of("foo"),
@@ -215,7 +215,7 @@ void overflowsAreRecoveredFrom(OnOverflow whichFiles) throws IOException {
215215
} else {
216216
// Give the watch some time to process the `OVERFLOW` event and
217217
// do internal bookkeeping
218-
TestHelper.trySleep(TestHelper.TINY_WAIT);
218+
Thread.sleep(TestHelper.TINY_WAIT.toMillis());
219219
}
220220

221221
// Create more files. They *should* be observed (regardless of

src/test/java/engineering/swat/watch/TestHelper.java

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -54,16 +54,4 @@ else if (os.contains("win")) {
5454
NORMAL_WAIT = Duration.ofSeconds(4 * delayFactor);
5555
LONG_WAIT = Duration.ofSeconds(8 * delayFactor);
5656
}
57-
58-
public static void trySleep(Duration duration) {
59-
trySleep(duration.toMillis());
60-
}
61-
62-
public static void trySleep(long millis) {
63-
try {
64-
Thread.sleep(millis);
65-
} catch (InterruptedException e) {
66-
throw new RuntimeException(e);
67-
}
68-
}
6957
}

0 commit comments

Comments
 (0)