You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The testDynamicRegistry test was failing randomly with
"Activity Listener not called" or "Category Listener not called" errors.
Root cause:
- The test uses a plain boolean array to track listener invocations
- Extension registry listeners may be invoked on different threads
- Without proper synchronization (volatile/atomic), changes to the array
made by listener threads may not be visible to the test thread
- This causes DisplayHelper.waitForCondition() to timeout even when
listeners were actually called
Fix:
- Replace boolean[] with AtomicBoolean instances for thread-safe visibility
- Use activityChanged.set(true) and categoryChanged.set(true) in listeners
- Use activityChanged.get() and categoryChanged.get() in assertions
- AtomicBoolean provides proper memory barriers ensuring cross-thread visibility
This approach ensures proper synchronization between the listener callback
threads and the test thread, eliminating the race condition that caused
random test failures.
Fixes#2458
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
0 commit comments