Skip to content

Conversation

@vogella
Copy link
Contributor

@vogella vogella commented Oct 24, 2025

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

Fixes eclipse-platform#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>
@github-actions
Copy link
Contributor

Test Results

 3 018 files  ±0   3 018 suites  ±0   2h 29m 16s ⏱️ + 3m 21s
 8 229 tests ±0   7 980 ✅ ±0  249 💤 ±0  0 ❌ ±0 
23 607 runs  ±0  22 813 ✅ ±0  794 💤 ±0  0 ❌ ±0 

Results for commit a7ad5ae. ± Comparison against base commit 126085a.

@vogella
Copy link
Contributor Author

vogella commented Oct 24, 2025

FYI @HeikoKlare @fedejeanne

@vogella vogella merged commit a988d08 into eclipse-platform:master Oct 24, 2025
18 checks passed
@vogella vogella deleted the fix-race-condition-in-mmenuitemtest branch October 24, 2025 16:23
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.

Random failing MMenuItemTest.testElementHierarchyInContext_HandledItem

1 participant