RFR: 8276058: Some swing test fails on specific CI macos system

Prasanta Sadhukhan psadhukhan at openjdk.java.net
Thu Oct 28 06:37:42 UTC 2021


On Wed, 27 Oct 2021 12:42:50 GMT, Prasanta Sadhukhan <psadhukhan at openjdk.org> wrote:

> As per JDK-8252813, some tests fails recurringly in CI macos system. This is an attempt to fix the swing tests.
> It was seen from the logs that we have color mismatch in these tests.
> 
> For example, in PressedIcon test, we had following log
> 
> ----------System.out:(1/75)----------
> color java.awt.Color[r=55,g=55,b=55] COLOR_1Xjava.awt.Color[r=255,g=0,b=0]
> ----------System.err:(13/842)----------
> java.lang.RuntimeException: Colors is different for scale=1!
> 	at PressedIconTest.main(PressedIconTest.java:97)
> 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:76)
> 	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:51)
> 	at java.base/java.lang.reflect.Method.invoke(Method.java:569)
> 	at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:127)
> 	at java.base/java.lang.Thread.run(Thread.java:833)
> 
> and JInternalFrame test, we had 
> ----------System.err:(15/939)----------
> FRAME_COLOR Red: 255; Green: 200; Blue: 0
> Pixel color Red: 55; Green: 55; Blue: 55
> java.lang.RuntimeException: Internal frame is not correctly dragged!
> 	at bug8069348.main(bug8069348.java:96)
> 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:76)
> 	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:51)
> 	at java.base/java.lang.reflect.Method.invoke(Method.java:569)
> 	at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:127)
> 	at java.base/java.lang.Thread.run(Thread.java:833)
> 
> where color is obtained as 55,55,55 instead of required color. The png image generated at failure also did not reveal anything abnormal apart from presence of mouse cursor around the same area where the getPixelColor location is pointing to. And since mouse cursor is also grayish black, it seems robot was wrongly picking up cursor pixels instead of background color.
> Modified tests to use location.x-10, location.y-10 to obtain the pixel color. It does not hamper the test as the whole area around the location is coloured with same color in the test so getting pixel color from a bit wide of the centre will not affect the test.
> Modified swing tests are passing in the affected system and also in other macos systems and platforms. Link in JBS.
> 
> The awt tests that are failing seems to have different root cause and will be handled separately.

awt test fix also added

FullScreenInsets fails with incorrect pixel so added tolerance
----------System.err:(15/899)----------
Incorrect pixel at 298x246 : ff00fe00 ,expected : ff00ff00
Incorrect pixel at 298x246 : fffe0000 ,expected : ffff0000
java.lang.RuntimeException: Test failed
	at FullScreenInsets.main(FullScreenInsets.java:93)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:76)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:51)
	at java.base/java.lang.reflect.Method.invoke(Method.java:569)
	at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:127)
	at java.base/java.lang.Thread.run(Thread.java:833)

MakeWindowAlwaysOnTop  fails with same root cause so used same swing tactics of x-10, y-10
----------System.out:(1/39)----------
Color = java.awt.Color[r=55,g=55,b=55]
----------System.err:(13/909)----------
java.lang.RuntimeException: Test FAILED: unknown window is on top of the frame
	at MakeWindowAlwaysOnTop.main(MakeWindowAlwaysOnTop.java:120)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:76)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:51)
	at java.base/java.lang.reflect.Method.invoke(Method.java:569)
	at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:127)
	at java.base/java.lang.Thread.run(Thread.java:833)

-------------

PR: https://git.openjdk.java.net/jdk/pull/6140



More information about the client-libs-dev mailing list