Commit a988d08
Fix race condition in MMenuItemTest by adding event loop processing
Fixes #1737
The test testElementHierarchyInContext_HandledItem was experiencing
intermittent failures due to a race condition. After creating handler
processing addons and activating parts, the handler registration may
not have completed before the test triggered the menu item selection.
This commit adds calls to contextRule.spinEventLoop() in both
testElementHierarchyInContext_DirectItem and
testElementHierarchyInContext_HandledItem to ensure all pending UI
events are processed before triggering menu item selection. This is
a standard pattern for preventing race conditions in Eclipse UI tests.
The spinEventLoop() method processes all pending events in the Display
event queue, ensuring that handler registration and context updates
have completed before the test proceeds.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>1 parent 126085a commit a988d08
File tree
1 file changed
+7
-0
lines changed- tests/org.eclipse.e4.ui.tests/src/org/eclipse/e4/ui/tests/workbench
1 file changed
+7
-0
lines changedLines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
763 | 763 | | |
764 | 764 | | |
765 | 765 | | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
766 | 769 | | |
767 | 770 | | |
768 | 771 | | |
| |||
836 | 839 | | |
837 | 840 | | |
838 | 841 | | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
839 | 846 | | |
840 | 847 | | |
841 | 848 | | |
| |||
0 commit comments