RFR: 8282771 : Create test case for JDK-8262981 [v2]

lawrence.andrews duke at openjdk.java.net
Wed Mar 16 21:17:45 UTC 2022


On Wed, 9 Mar 2022 21:36:06 GMT, Alexandre Iline <shurailine at openjdk.org> wrote:

>> lawrence.andrews has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Added command after the date
>
> test/jdk/javax/swing/JSlider/8262981/JSliderAccessibleAction.java line 179:
> 
>> 177:         for (String laf : instLookAndFeels) {
>> 178:             try {
>> 179:                 invalidDecrementCountDownLatch = new CountDownLatch(1);
> 
> these fields are accessed both from EDT and the main test thread

Fixed

> test/jdk/javax/swing/JSlider/8262981/JSliderAccessibleAction.java line 264:
> 
>> 262:                             "Increment button");
>> 263:                 }
>> 264:                 if (jSliderInitialValue.get() != currentJSliderValue.get()) {
> 
> This is  fundamentally unstable. 
> 
> You are clicking on the decrease button. The actual decrease which happened in the slider after the click may be more than you expect. Or less. 
> 
> The only reliable condition perhaps is that the value has decreased and even that may have a delayed effect, so it needs to be waited for. 
> 
> For example see  sanity/client/SwingSet/src/SliderDemoTest.java.

Fixed this by adding addChangeListener to JSlider and updating the currentJSliderValue.

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

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



More information about the client-libs-dev mailing list