Issue #8895 - fixing JettyHomeTester.await logs timeout
Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
This commit is contained in:
parent
af227778bb
commit
fd558f2eaa
|
@ -558,8 +558,8 @@ public class JettyHomeTester
|
||||||
*/
|
*/
|
||||||
public boolean awaitConsoleLogsFor(String txt, long time, TimeUnit unit) throws InterruptedException
|
public boolean awaitConsoleLogsFor(String txt, long time, TimeUnit unit) throws InterruptedException
|
||||||
{
|
{
|
||||||
long start = System.currentTimeMillis();
|
long end = System.currentTimeMillis() + unit.toMillis(time);
|
||||||
while (start < unit.toMillis(time))
|
while (System.currentTimeMillis() < end)
|
||||||
{
|
{
|
||||||
boolean result = logs.stream().anyMatch(s -> s.contains(txt));
|
boolean result = logs.stream().anyMatch(s -> s.contains(txt));
|
||||||
if (result)
|
if (result)
|
||||||
|
@ -586,8 +586,8 @@ public class JettyHomeTester
|
||||||
thread.start();
|
thread.start();
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
long start = System.currentTimeMillis();
|
long end = System.currentTimeMillis() + unit.toMillis(time);
|
||||||
while (start < unit.toMillis(time))
|
while (System.currentTimeMillis() < end)
|
||||||
{
|
{
|
||||||
boolean result = logs.stream().anyMatch(s -> s.contains(txt));
|
boolean result = logs.stream().anyMatch(s -> s.contains(txt));
|
||||||
if (result)
|
if (result)
|
||||||
|
|
Loading…
Reference in New Issue