From cce3ab6240bca8c6ca91047a0e47164cad5713cc Mon Sep 17 00:00:00 2001 From: Jacky Date: Tue, 19 Dec 2017 21:00:03 -0500 Subject: [PATCH] fix issue #1389 --- .../refine/tests/model/UrlFetchingTests.java | 22 +++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/main/tests/server/src/com/google/refine/tests/model/UrlFetchingTests.java b/main/tests/server/src/com/google/refine/tests/model/UrlFetchingTests.java index 3b84a5363..f4e67a99a 100644 --- a/main/tests/server/src/com/google/refine/tests/model/UrlFetchingTests.java +++ b/main/tests/server/src/com/google/refine/tests/model/UrlFetchingTests.java @@ -141,15 +141,19 @@ public class UrlFetchingTests extends RefineTest { Process process = op.createProcess(project, options); process.startPerforming(pm); Assert.assertTrue(process.isRunning()); - try { - // We have 100 rows and 500 ms per row but only two distinct - // values so we should not wait more than ~2000 ms to get the - // results. Just to make sure the test passes with plenty of - // net latency we sleep for longer (but still less than - // 50,000ms). - Thread.sleep(5000); - } catch (InterruptedException e) { - Assert.fail("Test interrupted"); + for(int i = 0;i < 12;i++) { + try { + // We have 100 rows and 500 ms per row but only two distinct + // values so we should not wait more than ~2000 ms to get the + // results. Just to make sure the test passes with plenty of + // net latency we sleep for longer (but still less than + // 50,000ms). + Thread.sleep(5000); + if (process.isDone()) + break; + } catch (InterruptedException e) { + Assert.fail("Test interrupted"); + } } Assert.assertFalse(process.isRunning());