From bdc0d9b21bbd56987e699adab64994f9fe2ccae5 Mon Sep 17 00:00:00 2001 From: Lorenzo Bettini Date: Mon, 20 Jan 2025 17:19:17 +0100 Subject: [PATCH] reallyWaitForAutoBuild after build --- .../xtext/ui/testing/util/IResourcesSetupUtil.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/org.eclipse.xtext.ui.testing/src/org/eclipse/xtext/ui/testing/util/IResourcesSetupUtil.java b/org.eclipse.xtext.ui.testing/src/org/eclipse/xtext/ui/testing/util/IResourcesSetupUtil.java index 1756182b6f7..d6854b22639 100644 --- a/org.eclipse.xtext.ui.testing/src/org/eclipse/xtext/ui/testing/util/IResourcesSetupUtil.java +++ b/org.eclipse.xtext.ui.testing/src/org/eclipse/xtext/ui/testing/util/IResourcesSetupUtil.java @@ -363,16 +363,21 @@ public static void waitForAutoBuild() { reallyWaitForAutoBuild(); } + + public static void reallyWaitForAutoBuild() { + reallyWaitForAutoBuild(new ConsoleLoggingProgressMonitor("AUTOBUILD")); + } + /** * A test that really should test the mechanism including the delay * after the resource change event, could wait for the auto build. */ - public static void reallyWaitForAutoBuild() { + public static void reallyWaitForAutoBuild(IProgressMonitor monitor) { boolean wasInterrupted = false; do { try { Job.getJobManager().join(ResourcesPlugin.FAMILY_AUTO_BUILD, - null); + monitor); wasInterrupted = false; } catch (OperationCanceledException e) { e.printStackTrace(); @@ -408,6 +413,7 @@ public static void waitForBuild(IProgressMonitor monitor) { try { waitForJdtIndex(); ResourcesPlugin.getWorkspace().build(IncrementalProjectBuilder.INCREMENTAL_BUILD, monitor); + reallyWaitForAutoBuild(new ConsoleLoggingProgressMonitor("AFTER BUILD")); } catch (CoreException e) { OperationCanceledException operationCanceledException = new OperationCanceledException(e.getMessage()); operationCanceledException.addSuppressed(e);