Skip to content

Commit

Permalink
Issue #8895 - fixing JettyHomeTester.await logs timeout
Browse files Browse the repository at this point in the history
Signed-off-by: Joakim Erdfelt <[email protected]>
  • Loading branch information
joakime committed Nov 16, 2022
1 parent af22777 commit fd558f2
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -558,8 +558,8 @@ public void close()
*/
public boolean awaitConsoleLogsFor(String txt, long time, TimeUnit unit) throws InterruptedException
{
long start = System.currentTimeMillis();
while (start < unit.toMillis(time))
long end = System.currentTimeMillis() + unit.toMillis(time);
while (System.currentTimeMillis() < end)
{
boolean result = logs.stream().anyMatch(s -> s.contains(txt));
if (result)
Expand All @@ -586,8 +586,8 @@ public boolean awaitLogsFileFor(Path logFile, String txt, long time, TimeUnit un
thread.start();
try
{
long start = System.currentTimeMillis();
while (start < unit.toMillis(time))
long end = System.currentTimeMillis() + unit.toMillis(time);
while (System.currentTimeMillis() < end)
{
boolean result = logs.stream().anyMatch(s -> s.contains(txt));
if (result)
Expand Down

0 comments on commit fd558f2

Please sign in to comment.