Skip to content

Conversation

@vogella
Copy link
Contributor

@vogella vogella commented Oct 24, 2025

Summary

Fixes #868

This PR fixes a race condition in DecoratorAdaptableTests that was causing intermittent test failures with the error:

"Adaptable test 1 has failed for object org.eclipse.ui.tests.menus.ObjectContributionClasses$A@..."

Problem

The tests were experiencing intermittent failures due to a race condition. After enabling decorators in the @Before method using setEnabled(), the decorator manager schedules asynchronous updates that may not have completed before the test assertions ran.

Solution

This PR applies the same pattern used to fix other race conditions in Eclipse UI tests (like the recent fix for MMenuItemTest in a988d08):

  1. Added import for UITestUtil which provides event loop processing utilities
  2. Added UITestUtil.processEvents() after decorator enablement in @Before to ensure all pending UI events are processed
  3. Added UITestUtil.processEvents() in @After to ensure a clean state for subsequent tests

The processEvents() method processes all pending events in the Display event queue, ensuring that decorator registration and enablement updates have completed before the test proceeds.

Test Plan

  • Successfully ran all 3 tests in DecoratorAdaptableTests:
    • testAdaptables
    • testNonAdaptableContributions
    • testContributorResourceAdapter
  • Ran tests multiple times to verify consistency
  • All tests passed with no failures or errors

Related Changes

This fix follows the same pattern as other recent race condition fixes in the repository.

🤖 Generated with Claude Code

…ocessing

Fixes eclipse-platform#868

The tests testAdaptables, testNonAdaptableContributions, and
testContributorResourceAdapter were experiencing intermittent failures
due to a race condition. After enabling decorators in the @before method,
the decorator manager schedules asynchronous updates that may not have
completed before the test assertions ran.

This commit adds calls to UITestUtil.processEvents() in both @before
and @after methods to ensure all pending UI events are processed before
tests run and after tests complete. This is a standard pattern for
preventing race conditions in Eclipse UI tests.

The processEvents() method processes all pending events in the Display
event queue, ensuring that decorator registration and enablement 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 33m 17s ⏱️ + 17m 36s
 8 229 tests ±0   7 979 ✅  - 1  249 💤 ±0  1 ❌ +1 
23 607 runs  ±0  22 812 ✅  - 1  794 💤 ±0  1 ❌ +1 

For more details on these failures, see this check.

Results for commit a6c3eb8. ± Comparison against base commit 4acc3e3.

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.

org.eclipse.ui.tests.decorators.DecoratorAdaptableTest.testAdaptables is failing on linux

1 participant