Skip to content

Run SafeRunnableErrorTest's other-thread case on another thread - #4455

Merged
vogella merged 1 commit into
eclipse-platform:masterfrom
vogella:lv/saferunnable-other-thread
Oct 8, 2026
Merged

vogella merged 1 commit into
eclipse-platform:masterfrom
vogella:lv/saferunnable-other-thread

Conversation

@vogella

@vogella vogella commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

testSafeRunnableHandlerOtherThread called Thread.run() instead of start(), so its runnable ran on the UI thread and the test covered nothing beyond testSafeRunnableHandler. It now starts the thread, asserts that the thread finished without an exception escaping and that the runnable ran once, and processes the error dialog that the workbench posts with asyncExec from a non-UI thread, so the dialog does not surface in a later test.

testSafeRunnableHandlerOtherThread called Thread.run() instead of
start(), so the runnable ran on the UI thread like the other tests and
the non-UI code path was never exercised. The thread is now started,
the test checks that the runnable ran without an exception escaping the
thread, and it processes the error dialog that the workbench posts
asynchronously from that thread.

Assisted-by: multiple AI agents and layers of automated tooling 🤖
@vogella
vogella force-pushed the lv/saferunnable-other-thread branch from 9377aeb to 519e03e Compare October 8, 2026 07:55
@github-actions

github-actions Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

Test Results

   864 files  ±0     864 suites  ±0   53m 33s ⏱️ + 4m 54s
 8 395 tests ±0   8 153 ✅ ±0  242 💤 ±0  0 ❌ ±0 
21 054 runs  ±0  20 377 ✅ ±0  677 💤 ±0  0 ❌ ±0 

Results for commit 519e03e. ± Comparison against base commit 21e6248.

@vogella
vogella merged commit e68f658 into eclipse-platform:master Oct 8, 2026
18 checks passed
@vogella
vogella deleted the lv/saferunnable-other-thread branch October 8, 2026 20:48
@iloveeclipse

Copy link
Copy Markdown
Member

This PR caused test fail today on all platforms, like: https://download.eclipse.org/eclipse/downloads/drops4/I20261008-2300/testresults/html/org.eclipse.jface.tests_ep442I-unit-linux-x86_64-java25_linux.gtk.x86_64_25.html

Workbench has not been created yet.

java.lang.IllegalStateException: Workbench has not been created yet.
at org.eclipse.ui.PlatformUI.getWorkbench(PlatformUI.java:119)
at org.eclipse.ui.tests.harness.util.UITestUtil.processEvents(UITestUtil.java:155)
at org.eclipse.jface.tests.dialogs.SafeRunnableErrorTest.testSafeRunnableHandlerOtherThread(SafeRunnableErrorTest.java:73)
at java.base/java.lang.reflect.Method.invoke(Method.java:565)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1604)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1604)

@vogella

vogella commented Oct 9, 2026

Copy link
Copy Markdown
Contributor Author

I have a look

@vogella

vogella commented Oct 9, 2026

Copy link
Copy Markdown
Contributor Author

Existing code which causes that, only before my change, the test never processed events, so it never touched PlatformUI. I push a PR soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants