From 604d75bbba6fa99f5dae780cbcf92f088d39aa80 Mon Sep 17 00:00:00 2001 From: Rob Stryker Date: Wed, 4 Dec 2024 15:21:52 -0500 Subject: [PATCH] testBug261722 Test case never ends if test fails Signed-off-by: Rob Stryker Cleanup Signed-off-by: Rob Stryker --- .../eclipse/jdt/core/tests/model/JavaSearchBugsTests.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchBugsTests.java b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchBugsTests.java index c94bfd7a45f..a20875f92ce 100644 --- a/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchBugsTests.java +++ b/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/JavaSearchBugsTests.java @@ -10737,11 +10737,14 @@ public void run() { } }; Thread thread = new Thread(search); + long start = System.nanoTime(); + long maxEnd = start + 10_000_000_000L; + thread.start(); // Delete project in current thread after being sure that the search // request was started - while (requestor.count < (MAX/3)) { + while (requestor.count < (MAX/3) && System.nanoTime() < maxEnd) { Thread.sleep(10); } deleteProject(javaProject);