Wait for the decoration jobs instead of sleeping a fixed time - #4287
Open
vogella wants to merge 1 commit into
Open
Wait for the decoration jobs instead of sleeping a fixed time#4287vogella wants to merge 1 commit into
vogella wants to merge 1 commit into
Conversation
DecorationSchedulerRaceConditionTest slept 500 ms and assumed the update job had run by then. Waiting for the FAMILY_DECORATE jobs to finish is both faster and independent of the scheduler's internal delay.
Contributor
There was a problem hiding this comment.
Pull request overview
Replaces fixed delays in the navigator decoration race-condition test with event-loop-aware job completion waits.
Changes:
- Polls the decoration job family while processing UI events.
- Adds a 5-second timeout with an explicit failure message.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
DecorationSchedulerRaceConditionTestslept a fixed 500 ms after each decoration and assumed the update job had run by then. That ties the test toDecorationScheduler.UPDATE_DELAY, an internal constant it has no business knowing about.It now waits for the
FAMILY_DECORATEjobs to finish instead. A plainjoinon the family would deadlock, because the update job is aWorkbenchJobthat needs the UI thread, so the wait spins the event loop throughDisplayHelperand polls the job manager.The timeout goes from 500 ms to 5 s since it is an upper bound now rather than an unconditional sleep. In practice the test gets faster (both cases run in 2.8 s), and a timeout fails with a clear message instead of an
assertEqualson stale text.