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

8315415: OutputAnalyzer.shouldMatchByLine() fails in some cases #15753

Closed
wants to merge 1 commit into from

Conversation

lmesnik
Copy link
Member

@lmesnik lmesnik commented Sep 14, 2023

OutputAnalyzer.shouldMatchByLine(from, to, pattern)
treat from and to parameters as patterns and not lines. So it might fail to compile them or work not as expected in some cases.

I grepped the usage of shouldMatchByLine and stdoutShouldMatchByLine and found that in most cases from/to are set to some regex patterns. So I just updated the names of variables and documentation to explicitly say that from/to are patterns.

See bugs for details. Tested with tier1 (mostly for validation scripts since no code changes.)


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-8315415: OutputAnalyzer.shouldMatchByLine() fails in some cases (Bug - P4)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 15753

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

Using diff file

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

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Sep 14, 2023

👋 Welcome back lmesnik! 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.

@lmesnik
Copy link
Member Author

lmesnik commented Sep 14, 2023

/cc hotspot

@openjdk openjdk bot added rfr Pull request is ready for review hotspot hotspot-dev@openjdk.org labels Sep 14, 2023
@openjdk
Copy link

openjdk bot commented Sep 14, 2023

@lmesnik
The hotspot label was successfully added.

@mlbridge
Copy link

mlbridge bot commented Sep 14, 2023

Webrevs

Copy link
Member

@dholmes-ora dholmes-ora left a comment

Choose a reason for hiding this comment

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

This seems reasonable. But it doesn't seem to fix the issue that was reported in the bug report. Was that test subsequently modified to ensure the line did not happen to contain regex pattern meta-characters?

@lmesnik
Copy link
Member Author

lmesnik commented Sep 15, 2023

The test doesn't use this API. As I understand Calvin find this problem while writing tests, and decided to just to write it other way.

Copy link
Member

@dholmes-ora dholmes-ora left a comment

Choose a reason for hiding this comment

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

Okay - thanks.

@openjdk
Copy link

openjdk bot commented Sep 15, 2023

@lmesnik 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:

8315415: OutputAnalyzer.shouldMatchByLine() fails in some cases

Reviewed-by: dholmes

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 5 new commits pushed to the master branch:

  • 783e44d: 8316326: ProblemList java/awt/Mouse/EnterExitEvents/DragWindowTest.java on macosx-all again
  • 96781ba: 8312332: C2: Refactor SWPointer out from SuperWord
  • b55e418: 8301991: Convert l10n properties resource bundles to UTF-8 native
  • d475f61: 8315731: Open source several Swing Text related tests
  • 4415261: 8315683: Parallelize java/util/concurrent/tck/JSR166TestCase.java

Please see this link for an up-to-date comparison between the source branch of this pull request and the master branch.
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 ready Pull request is ready to be integrated label Sep 15, 2023
@lmesnik
Copy link
Member Author

lmesnik commented Sep 19, 2023

/integrate

@openjdk
Copy link

openjdk bot commented Sep 19, 2023

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

  • da57d2a: 8308592: Framework for CA interoperability testing
  • a6d120d: 8316513: Serial: Remove unused invalidate_remembered_set
  • 607bd4e: 8316294: AIX: Build fopen system call fails on file _BUILD_LIBJDWP_objectfilenames.txt
  • f25c920: 8314774: Optimize URLEncoder
  • 7c5f2a2: 8315669: Open source several Swing PopupMenu related tests
  • cf74b8c: 8316337: (bf) Concurrency issue in DirectByteBuffer.Deallocator
  • 4461eeb: 8312498: Thread::getState and JVM TI GetThreadState should return TIMED_WAITING virtual thread is timed parked
  • 670b456: 8315038: Capstone disassembler stops when it sees a bad instruction
  • fab372d: 8316428: G1: Nmethod count statistics only count last code root set iterated
  • 283c360: 8314877: Make fields final in 'java.net' package
  • ... and 50 more: https://git.openjdk.org/jdk/compare/b2e91060db82a13e993227f538c8d54b41a9796b...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Sep 19, 2023

@lmesnik Pushed as commit 7b1e2bf.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hotspot hotspot-dev@openjdk.org integrated Pull request has been integrated
2 participants