Skip to content

Add caching regression tests for FontRegistry - #4249

Merged
HeikoKlare merged 1 commit into
eclipse-platform:masterfrom
HeikoKlare:fontregistry-tests
Aug 14, 2026
Merged

Add caching regression tests for FontRegistry#4249
HeikoKlare merged 1 commit into
eclipse-platform:masterfrom
HeikoKlare:fontregistry-tests

Conversation

@HeikoKlare

Copy link
Copy Markdown
Contributor

Guard the font-caching invariants that FontRegistry relies on: get(), getBold() and getItalic() return the identical Font instance across repeated lookups, a symbolic name that was never registered stably falls back to the default font, and the default font stays stable when other names are looked up (including from a non-UI thread).

Also cover the surrounding put() contract: hasValueFor()/getKeySet() only reflect explicitly registered names, getFontData()/getDescriptor() fall back to the default like get() does, put() only fires a property change when the data actually changes, put() with new data invalidates previously cached base/bold/italic fonts, and a font replaced by put() stays usable until its Display is disposed rather than being disposed immediately.

Note

We are currently invesigating issues with FontRegistry in multi-display usage scenarios on Windows. In order to prevent regression (during according fixes and other changes to FontRegistry), this adds a bunch of tests for essential contracts of the class as the FontRegistry is badly tested right now.

@github-actions

github-actions Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Test Results

   858 files  ± 0     858 suites  ±0   50m 8s ⏱️ - 16m 39s
 8 171 tests +11   7 928 ✅ +13  243 💤 ±0  0 ❌  - 2 
20 415 runs  +33  19 759 ✅ +33  656 💤 +2  0 ❌  - 2 

Results for commit 7a644d7. ± Comparison against base commit 6fae142.

♻️ This comment has been updated with latest results.

@HeikoKlare
HeikoKlare marked this pull request as ready for review August 13, 2026 17:47
@HeikoKlare
HeikoKlare requested a lite review from Copilot August 13, 2026 17:48

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds regression tests to FontRegistry (JFace resources) to guard key caching and fallback invariants, especially around repeated lookups, default-font stability, and update/replace semantics (including multi-Display behavior on Windows).

Changes:

  • Add tests asserting stable/identical Font instances across repeated get() / getBold() / getItalic() calls.
  • Add tests for fallback behavior of unknown symbolic names and for hasValueFor() / getKeySet() only reflecting explicitly registered entries.
  • Add tests for put() semantics (property-change emission only on actual data changes, cache invalidation on updates, and delayed disposal until Display disposal).

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Guard the font-caching invariants that FontRegistry relies on: get(),
getBold() and getItalic() return the identical Font instance across
repeated lookups, a symbolic name that was never registered stably
falls back to the default font, and the default font stays stable
when other names are looked up (including from a non-UI thread).

Also cover the surrounding put() contract: hasValueFor()/getKeySet()
only reflect explicitly registered names, getFontData()/getDescriptor()
fall back to the default like get() does, put() only fires a property
change when the data actually changes, put() with new data invalidates
previously cached base/bold/italic fonts, and a font replaced by put()
stays usable until its Display is disposed rather than being disposed
immediately.
@HeikoKlare
HeikoKlare merged commit 75b192a into eclipse-platform:master Aug 14, 2026
18 checks passed
@HeikoKlare
HeikoKlare deleted the fontregistry-tests branch August 14, 2026 11:42
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.

2 participants