Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8346324: javax/swing/JScrollBar/4865918/bug4865918.java fails in CI #22783

Closed
wants to merge 4 commits into from

Conversation

prsadhuk
Copy link
Contributor

@prsadhuk prsadhuk commented Dec 17, 2024

javax/swing/JScrollBar/4865918/bug4865918.java fails in CI citing

java.lang.RuntimeException: The scrollbar block increment is incorrect
at bug4865918.main(bug4865918.java:60)

Seems like scrollbar is not in focus when mouse is pressed..Used CountDownLatch to mage focus gain more determinisitic.
Fix is passing in CI in several CI systems


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8346324: javax/swing/JScrollBar/4865918/bug4865918.java fails in CI (Bug - P4)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/22783/head:pull/22783
$ git checkout pull/22783

Update a local copy of the PR:
$ git checkout pull/22783
$ git pull https://git.openjdk.org/jdk.git pull/22783/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 22783

View PR using the GUI difftool:
$ git pr show -t 22783

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/22783.diff

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Dec 17, 2024

👋 Welcome back psadhukhan! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented Dec 17, 2024

@prsadhuk This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8346324: javax/swing/JScrollBar/4865918/bug4865918.java fails in CI

Reviewed-by: aivanov, abhiscxk

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 113 new commits pushed to the master branch:

  • 8efc558: 8346378: Cannot use DllMain in libnet for static builds
  • 73b5dba: 8345655: Move reservation code out of ReservedSpace
  • d50b725: 8344647: Make java.se participate in the preview language feature requires transitive java.base
  • 9e8aa85: 8346017: Socket.connect specified to throw UHE for unresolved address is problematic for SOCKS V5 proxy
  • 5b703c7: 8342782: AWTEventMulticaster throws StackOverflowError using AquaButtonUI
  • edbd76c: 8344951: Stabilize write barrier micro-benchmarks
  • 842f801: 8339331: GCC fortify error in vm_version_linux_aarch64.cpp
  • 4533109: 8345911: Enhance error message when IncompatibleClassChangeError is thrown for sealed class loading failures
  • ea50c54: 8321818: vmTestbase/nsk/stress/strace/strace015.java failed with 'Cannot read the array length because "" is null'
  • c0f0b8e: 8346151: Add transformer error logging to VerifyLocalVariableTableOnRetransformTest
  • ... and 103 more: https://git.openjdk.org/jdk/compare/8de0622c3a5c9e01e79659ef0b43b1b01dfa5cf6...master

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot added the rfr Pull request is ready for review label Dec 17, 2024
@openjdk
Copy link

openjdk bot commented Dec 17, 2024

@prsadhuk The following label will be automatically applied to this pull request:

  • client

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added the client client-libs-dev@openjdk.org label Dec 17, 2024
@mlbridge
Copy link

mlbridge bot commented Dec 17, 2024

Webrevs

Copy link
Member

@aivanov-jdk aivanov-jdk left a comment

Choose a reason for hiding this comment

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

In the description you say, “scrollbar is not in focus when mouse is pressed.” Yet there's nothing in the test which handles the focus… even in the updated test.

However, I agree that your update makes the test more reliable, the latch guarantees the synthetic mouse event is handled before analysing the result.

So, it looks good exception for a couple of nits.

Comment on lines 47 to 50
private static volatile CountDownLatch latch;

public static void main(String[] argv) throws Exception {
latch = new CountDownLatch(1);
Copy link
Member

Choose a reason for hiding this comment

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

Initialise the latch at its declaration.

Suggested change
private static volatile CountDownLatch latch;
public static void main(String[] argv) throws Exception {
latch = new CountDownLatch(1);
private static final CountDownLatch latch = new CountDownLatch(1);
public static void main(String[] argv) throws Exception {

mousePressLatch would be a more descriptive name.

@@ -52,6 +56,7 @@ public static void main(String[] argv) throws Exception {
robot.delay(1000);

SwingUtilities.invokeAndWait(() -> sbar.pressMouse());
latch.await();
Copy link
Member

Choose a reason for hiding this comment

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

You should use timed await and throw an exception if the wait times out. This way the timeout would be handled more gracefully… and more quickly, a two-second timeout should be enough.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated..

Copy link
Contributor

@kumarabhi006 kumarabhi006 left a comment

Choose a reason for hiding this comment

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

Seems good.

@@ -34,14 +34,18 @@
import javax.swing.JFrame;
import javax.swing.JScrollBar;
import javax.swing.SwingUtilities;
import java.awt.event.MouseAdapter;
Copy link
Contributor

Choose a reason for hiding this comment

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

awt imports can be grouped together.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Dec 18, 2024
@@ -56,7 +56,7 @@ public static void main(String[] argv) throws Exception {
robot.delay(1000);

SwingUtilities.invokeAndWait(() -> sbar.pressMouse());
latch.await();
mousePressLatch.await(2, TimeUnit.SECONDS);
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
mousePressLatch.await(2, TimeUnit.SECONDS);
if (!mousePressLatch.await(2, TimeUnit.SECONDS)) {
throw new RuntimeException("Timed out waiting for mouse press");
}

If you don't throw the exception, the test will continue to run… Yet we're sure it is likely to fail.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok..modified..

@openjdk openjdk bot removed the ready Pull request is ready to be integrated label Dec 18, 2024
@openjdk openjdk bot added the ready Pull request is ready to be integrated label Dec 18, 2024
@prsadhuk
Copy link
Contributor Author

/integrate

@openjdk
Copy link

openjdk bot commented Dec 18, 2024

Going to push as commit a0b7c4f.
Since your change was applied there have been 113 commits pushed to the master branch:

  • 8efc558: 8346378: Cannot use DllMain in libnet for static builds
  • 73b5dba: 8345655: Move reservation code out of ReservedSpace
  • d50b725: 8344647: Make java.se participate in the preview language feature requires transitive java.base
  • 9e8aa85: 8346017: Socket.connect specified to throw UHE for unresolved address is problematic for SOCKS V5 proxy
  • 5b703c7: 8342782: AWTEventMulticaster throws StackOverflowError using AquaButtonUI
  • edbd76c: 8344951: Stabilize write barrier micro-benchmarks
  • 842f801: 8339331: GCC fortify error in vm_version_linux_aarch64.cpp
  • 4533109: 8345911: Enhance error message when IncompatibleClassChangeError is thrown for sealed class loading failures
  • ea50c54: 8321818: vmTestbase/nsk/stress/strace/strace015.java failed with 'Cannot read the array length because "" is null'
  • c0f0b8e: 8346151: Add transformer error logging to VerifyLocalVariableTableOnRetransformTest
  • ... and 103 more: https://git.openjdk.org/jdk/compare/8de0622c3a5c9e01e79659ef0b43b1b01dfa5cf6...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Dec 18, 2024
@openjdk openjdk bot closed this Dec 18, 2024
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Dec 18, 2024
@openjdk
Copy link

openjdk bot commented Dec 18, 2024

@prsadhuk Pushed as commit a0b7c4f.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

@prsadhuk prsadhuk deleted the OCItest9 branch December 18, 2024 15:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
client client-libs-dev@openjdk.org integrated Pull request has been integrated
Development

Successfully merging this pull request may close these issues.

3 participants