Check also device native zoom in Test_org_eclipse_swt_widgets_Shell - #3598
trancexpress wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
No unresolved issues were identified that would block approval.
Pull request overview
Adjusts Shell size assertions to tolerate a one-pixel discrepancy on Windows, preventing intermittent I-build failures.
Changes:
- Uses the tolerance helper in both integer- and
Point-based size tests. - Enables one-pixel tolerance for Windows shells.
File summaries
| File | Description |
|---|---|
| tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_widgets_Shell.java | Updated as part of this pull request. |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
@akurtakov WDYT here? Should we try to investigate the 1 pixel height difference, or just ignore it? |
|
It is always good to chase such things if someone has time for it. As it's Windows thing I'll defer to @HeikoKlare to have a say. |
|
One of the fails is at: So zoom was 100 (no tolerance for the diff in The other fail looks more or less the same, aside from not calling Maybe
I think the actual value used for size computations is |
302cd5c to
a858516
Compare
Some test methods in Test_org_eclipse_swt_widgets_Shell fail on Windows with an unexpected Shell size, where the difference is one less pixel for the Shell height. This change broadens the tolerance of 1 pixel on Shell zoom levels different than 100 to apply also if DPIUtil.getNativeDeviceZoom() returns a value which is not 100. The actual zoom value used for size computations is taken from Control.computeBoundsZoom(), which delegates to DPIUtil.getNativeDeviceZoom(). Fixes: eclipse-platform#3597
a858516 to
af39102
Compare
HeikoKlare
left a comment
There was a problem hiding this comment.
Thank you for working on the test failure. The proposed fix may only solve a test failure that happens on a system with two monitors, one at 100% an one at a different zoom, and with another shell than the test shell being moved to a different monitor than the test shell is placed on while the assertion is evaluated (otherwise shell.getZoom() == DPIUtil.getNativeDeviceZoom()). I am not very confident that we have that situation in I-Builds. Actually, I expect our Jenkins Windows agent to just have a single-monitor setup with 100%.
With some analysis I found a bug in the actual business logic that may cause this issue. Even though not 100% sure if that is actually the cause, we should fix that bug anyway. And I propose to then wait for several I-Builds to see if the test failure happens again or if that fix has already resolved it:
Alright, lets close this PR in favor of your fix. Hopefully the fails are gone, if not we can always re-open. Thank you for taking a look! |
Some test methods in
Test_org_eclipse_swt_widgets_Shellfail on Windows with an unexpectedShellsize, where the difference is one less pixel for theShellheight.This change broadens the tolerance of 1 pixel on
Shellzoom levels different than 100 to apply also ifDPIUtil.getNativeDeviceZoom()returns a value which is not 100.The actual zoom value used for size computations is taken from
Control.computeBoundsZoom(), which delegates toDPIUtil.getNativeDeviceZoom().Fixes: #3597