Skip to content

Commit

Permalink
Fix a failing test maybe?
Browse files Browse the repository at this point in the history
Signed-off-by: Rob Stryker <[email protected]>
  • Loading branch information
robstryker committed Dec 7, 2023
1 parent 7510c06 commit 859dd00
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,12 @@ public void testGetAndCancelJob() throws InterruptedException, ExecutionExceptio
double actualProgress = jobProgress.getPercent();
assertTrue(actualProgress >= 0.0);
// check that there is progress in bits downloading. wait for a while
sleep(3000);
jobs = serverProxy.getJobs().get(REQUEST_TIMEOUT, TimeUnit.MILLISECONDS);
jobProgress = jobs.stream().filter(job -> job.getHandle().getId().equals(downloadJobId)).findAny().orElse(null);
int i = 0;
while(i++ < 3 && jobProgress == null) {
sleep(2000);
jobs = serverProxy.getJobs().get(REQUEST_TIMEOUT, TimeUnit.MILLISECONDS);
jobProgress = jobs.stream().filter(job -> job.getHandle().getId().equals(downloadJobId)).findAny().orElse(null);
}
assertNotNull(jobProgress);
assertTrue(jobProgress.getPercent() > 0.0 && jobProgress.getPercent() != actualProgress);
// Cancel downloading
Expand Down

0 comments on commit 859dd00

Please sign in to comment.