Increase the likelihood that timed tests pass on CI server
This commit is contained in:
parent
60c551a95b
commit
cd9cad31f9
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2020 the original author or authors.
|
||||
* Copyright 2002-2021 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -67,7 +67,7 @@ class TimedTransactionalSpringExtensionTests {
|
|||
event(test("WithExceededJUnitJupiterTimeout"),
|
||||
finishedWithFailure(
|
||||
instanceOf(TimeoutException.class),
|
||||
message(msg -> msg.endsWith("timed out after 50 milliseconds")))));
|
||||
message(msg -> msg.endsWith("timed out after 10 milliseconds")))));
|
||||
}
|
||||
|
||||
|
||||
|
@ -83,10 +83,10 @@ class TimedTransactionalSpringExtensionTests {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Timeout(value = 50, unit = TimeUnit.MILLISECONDS)
|
||||
@Timeout(value = 10, unit = TimeUnit.MILLISECONDS)
|
||||
void transactionalWithExceededJUnitJupiterTimeout() throws Exception {
|
||||
assertThatTransaction().isActive();
|
||||
Thread.sleep(100);
|
||||
Thread.sleep(200);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -97,11 +97,11 @@ class TimedTransactionalSpringExtensionTests {
|
|||
}
|
||||
|
||||
@Test
|
||||
@Timeout(value = 50, unit = TimeUnit.MILLISECONDS)
|
||||
@Timeout(value = 10, unit = TimeUnit.MILLISECONDS)
|
||||
@Transactional(propagation = Propagation.NOT_SUPPORTED)
|
||||
void notTransactionalWithExceededJUnitJupiterTimeout() throws Exception {
|
||||
assertThatTransaction().isNotActive();
|
||||
Thread.sleep(100);
|
||||
Thread.sleep(200);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
* Copyright 2002-2021 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -76,14 +76,14 @@ public class TimedSpringRunnerTests {
|
|||
}
|
||||
|
||||
// Should Fail due to timeout.
|
||||
@Test(timeout = 100)
|
||||
@Test(timeout = 10)
|
||||
public void jUnitTimeoutWithSleep() throws Exception {
|
||||
Thread.sleep(200);
|
||||
}
|
||||
|
||||
// Should Fail due to timeout.
|
||||
@Test
|
||||
@Timed(millis = 100)
|
||||
@Timed(millis = 10)
|
||||
public void springTimeoutWithSleep() throws Exception {
|
||||
Thread.sleep(200);
|
||||
}
|
||||
|
@ -97,7 +97,7 @@ public class TimedSpringRunnerTests {
|
|||
|
||||
// Should Fail due to timeout.
|
||||
@Test
|
||||
@MetaTimedWithOverride(millis = 100)
|
||||
@MetaTimedWithOverride(millis = 10)
|
||||
public void springTimeoutWithSleepAndMetaAnnotationAndOverride() throws Exception {
|
||||
Thread.sleep(200);
|
||||
}
|
||||
|
@ -110,7 +110,7 @@ public class TimedSpringRunnerTests {
|
|||
}
|
||||
}
|
||||
|
||||
@Timed(millis = 100)
|
||||
@Timed(millis = 10)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
private static @interface MetaTimed {
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue