diff --git a/oap-stdlib/src/main/java/oap/testng/Asserts.java b/oap-stdlib/src/main/java/oap/testng/Asserts.java index a41a4ff0a2..3a3bc04044 100644 --- a/oap-stdlib/src/main/java/oap/testng/Asserts.java +++ b/oap-stdlib/src/main/java/oap/testng/Asserts.java @@ -45,6 +45,7 @@ import java.lang.reflect.Method; import java.net.URL; import java.nio.file.Path; +import java.time.Duration; import java.util.Map; import static java.util.stream.Collectors.toList; @@ -76,11 +77,15 @@ public static void eventually( long retryTimeout, int retries, Try.ThrowingRunna else throw new AssertionError( "timeout" ); } - @SneakyThrows public static void assertEventually( long retryTimeout, int retries, oap.util.function.Try.ThrowingRunnable asserts ) { eventually( retryTimeout, retries, asserts ); } + public static void assertEventually( Duration duration, Duration retryInterval, oap.util.function.Try.ThrowingRunnable asserts ) { + int retries = ( int ) ( duration.toMillis() / retryInterval.toMillis() ); + eventually( retryInterval.toMillis(), retries, asserts ); + } + @Deprecated public static void assertEquals( java.util.stream.Stream actual, java.util.stream.Stream expected ) { if( actual == null && expected != null ) fail( "actual stream is null" ); diff --git a/pom.xml b/pom.xml index 0e869bca54..a8560d452d 100644 --- a/pom.xml +++ b/pom.xml @@ -37,7 +37,7 @@ - 18.11.8 + 18.11.9 7.8.0 3.24.2