From 81d7c387f05049b1ca54fdf6a75f926aa1e8d989 Mon Sep 17 00:00:00 2001 From: Lars Vogel Date: Wed, 7 Oct 2026 10:14:35 +0200 Subject: [PATCH] Flush workspace notifications in SmartImportTests single-operation test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The POST_CHANGE event of the import can still be pending in the workspace notification job when SmartImportJob.run returns, so the test occasionally counted 0 events. A checkpoint delivers it before the assertion. Assisted-by: multiple AI agents and layers of automated tooling 🤖 --- .../org/eclipse/ui/tests/datatransfer/SmartImportTests.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/datatransfer/SmartImportTests.java b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/datatransfer/SmartImportTests.java index fde1bbf941f..26f38c8130f 100644 --- a/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/datatransfer/SmartImportTests.java +++ b/tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/datatransfer/SmartImportTests.java @@ -220,6 +220,8 @@ public void testProjectsAreCreatedInASingleWorkspaceOperation() throws Exception job.setDirectoriesToImport(directories); ResourcesPlugin.getWorkspace().addResourceChangeListener(listener, IResourceChangeEvent.POST_CHANGE); IStatus status = job.run(new NullProgressMonitor()); + // a delta the workspace deferred to its notification job must arrive before counting + ResourcesPlugin.getWorkspace().checkpoint(false); assertTrue("Import failed: " + status, status.isOK()); assertEquals(directories.size(), ResourcesPlugin.getWorkspace().getRoot().getProjects().length);