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

8320712: Rewrite BadFactoryTest in pure Java #16830

Closed
wants to merge 9 commits into from

Conversation

eirbjo
Copy link
Contributor

@eirbjo eirbjo commented Nov 27, 2023

Please review this PR which rewrites the BadFactoryTest to pure Java/JUnit. The test is currently implemented using a mix of shell script and a Java main method.

Reviewers may notice the following changes:

  • The shell script file BadFactoryTest.sh has been retired and jtreg tags moved over to BadFactoryTest.java
  • The main method has been replaced with a JUnit @Test method
  • The service definition file used to be packaged into a jar file, now the source directory is instead directly added to the classpath using @library /javax/script/JDK_8196959
  • The @summary tag was updated since the existing summary was slightly confusing
  • To make jtreg happy, the SecurityManager-enabled invocation now runs with -Djava.security.manager=allow instead of just -Djava.security.manager
  • A sanity check was added to verify that ScriptEngineManager can actually find and load BadFactory. Such a check would have detected the issue which inspired this rewrite, see 8319668: Fixup of jar filename typo in BadFactoryTest.sh #16585.

Verified by running:

% make test TEST="test/jdk/javax/script/JDK_8196959"
  [..]
   TEST                                              TOTAL  PASS  FAIL ERROR   
   jtreg:test/jdk/javax/script/JDK_8196959               1     1     0     0   

Note that the original issue JDK-8196959 is not available in JBS, so my understanding of what the original test does is based on code inspection.


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-8320712: Rewrite BadFactoryTest in pure Java (Enhancement - P4)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 16830

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

Using diff file

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

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Nov 27, 2023

👋 Welcome back eirbjo! 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 Nov 27, 2023

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

  • core-libs

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 core-libs core-libs-dev@openjdk.org label Nov 27, 2023
@openjdk
Copy link

openjdk bot commented Nov 28, 2023

@eirbjo this pull request can not be integrated into master due to one or more merge conflicts. To resolve these merge conflicts and update this pull request you can run the following commands in the local repository for your personal fork:

git checkout badfactory-java-rewritte
git fetch https://git.openjdk.org/jdk.git master
git merge FETCH_HEAD
# resolve conflicts and follow the instructions given by git merge
git commit -m "Merge master"
git push

@openjdk openjdk bot added the merge-conflict Pull request has merge conflict with target branch label Nov 28, 2023
# Conflicts:
#	test/jdk/javax/script/JDK_8196959/BadFactoryTest.sh
@openjdk openjdk bot removed the merge-conflict Pull request has merge conflict with target branch label Nov 28, 2023
@eirbjo eirbjo marked this pull request as ready for review November 28, 2023 14:06
@openjdk openjdk bot added the rfr Pull request is ready for review label Nov 28, 2023
@mlbridge
Copy link

mlbridge bot commented Nov 28, 2023

Webrevs

@bridgekeeper
Copy link

bridgekeeper bot commented Dec 26, 2023

@eirbjo This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

@bridgekeeper
Copy link

bridgekeeper bot commented Jan 24, 2024

@eirbjo This pull request has been inactive for more than 8 weeks and will now be automatically closed. If you would like to continue working on this pull request in the future, feel free to reopen it! This can be done using the /open pull request command.

@bridgekeeper bridgekeeper bot closed this Jan 24, 2024
@jaikiran
Copy link
Member

Hello Eirik, what's being proposed here looks good to me. It's good that this is being migrated from a shell based test to a java based test. So if you are interested in pursuing this further, please reopen the PR.

The only part that is unclear to me is the use of @library /javax/script/JDK_8196959. Does the test fail if that isn't added?

@eirbjo
Copy link
Contributor Author

eirbjo commented Jan 24, 2024

/open

@openjdk openjdk bot reopened this Jan 24, 2024
@openjdk
Copy link

openjdk bot commented Jan 24, 2024

@eirbjo This pull request is now open

@eirbjo
Copy link
Contributor Author

eirbjo commented Jan 24, 2024

The only part that is unclear to me is the use of @library /javax/script/JDK_8196959. Does the test fail if that isn't added?

Thanks! I must have thought this was required to put the service definition file on the classpath. But it isn't.

I have removed the @library tag and also merged with a more recent master.

Copy link
Member

@jaikiran jaikiran left a comment

Choose a reason for hiding this comment

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

Thank you for the update. This test-only change looks OK to me.

Hello Sundar @sundararajana, given your past work on this test, do you have any thoughts on this change?

@openjdk
Copy link

openjdk bot commented Jan 24, 2024

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

8320712: Rewrite BadFactoryTest in pure Java

Reviewed-by: jpai, sundar

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

  • 725314f: 8324771: Obsolete RAMFraction related flags
  • ec6c35c: 8324970: Serial: Refactor signature of maintain_old_to_young_invariant
  • b5c267f: 8324632: Update Zlib Data Compression Library to Version 1.3.1
  • ec56c72: 8323601: Improve LayoutPath.PathElement::toString
  • f7121de: 8322648: Improve class initialization barrier in TemplateTable::_new for PPC
  • 577de17: 8259550: The content of the print out displayed incomplete with the NimbusLAF
  • 83b3c9b: 8322649: Improve class initialization barrier in TemplateTable::_new for S390
  • 7d1a488: 8324861: Exceptions::wrap_dynamic_exception() doesn't have ResourceMark
  • c3c1d5b: 8324998: Add test cases for String.regionMatches comparing Turkic dotted/dotless I with uppercase latin I
  • 8892d45: 8324582: Replace -Djava.util.concurrent.ForkJoinPool.common.parallelism to -Djdk.virtualThreadScheduler.maxPoolSize in jvmti vthread tests
  • ... and 227 more: https://git.openjdk.org/jdk/compare/e10d14004fa25998231ab1d2611b75aea9b5c67d...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 ready Pull request is ready to be integrated label Jan 24, 2024
@eirbjo
Copy link
Contributor Author

eirbjo commented Jan 31, 2024

Hello Sundar @sundararajana, given your past work on this test, do you have any thoughts on this change?

@jaikiran We have not heard back from @sundararajana in the last week. It would be nice to see this low-risk change integrated.

I'm sure we can respond to any post-integration feedback with a follow-up PR. Do you agree?

Copy link
Member

@sundararajana sundararajana left a comment

Choose a reason for hiding this comment

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

LGTM

@eirbjo
Copy link
Contributor Author

eirbjo commented Jan 31, 2024

/integrate

@jaikiran
Copy link
Member

Hello Eirik @eirbjo, please give me a few more hours. I just now noticed that this test resides in tier2, so github actions job doesn't cover it. I'll trigger a CI run and once it's done successfully, you can go ahead and integrate this.

@openjdk
Copy link

openjdk bot commented Jan 31, 2024

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

  • 725314f: 8324771: Obsolete RAMFraction related flags
  • ec6c35c: 8324970: Serial: Refactor signature of maintain_old_to_young_invariant
  • b5c267f: 8324632: Update Zlib Data Compression Library to Version 1.3.1
  • ec56c72: 8323601: Improve LayoutPath.PathElement::toString
  • f7121de: 8322648: Improve class initialization barrier in TemplateTable::_new for PPC
  • 577de17: 8259550: The content of the print out displayed incomplete with the NimbusLAF
  • 83b3c9b: 8322649: Improve class initialization barrier in TemplateTable::_new for S390
  • 7d1a488: 8324861: Exceptions::wrap_dynamic_exception() doesn't have ResourceMark
  • c3c1d5b: 8324998: Add test cases for String.regionMatches comparing Turkic dotted/dotless I with uppercase latin I
  • 8892d45: 8324582: Replace -Djava.util.concurrent.ForkJoinPool.common.parallelism to -Djdk.virtualThreadScheduler.maxPoolSize in jvmti vthread tests
  • ... and 227 more: https://git.openjdk.org/jdk/compare/e10d14004fa25998231ab1d2611b75aea9b5c67d...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Jan 31, 2024

@eirbjo Pushed as commit 6697160.

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

@eirbjo
Copy link
Contributor Author

eirbjo commented Jan 31, 2024

Hello Eirik @eirbjo, please give me a few more hours. I just now noticed that this test resides in tier2, so github actions job doesn't cover it. I'll trigger a CI run and once it's done successfully, you can go ahead and integrate this.

Whoops, I just integrated after the approval from @sundararajana, seconds before this comment.

What is the best action here, just have a rollback PR ready in case of failures?

@jaikiran
Copy link
Member

Whoops, I just integrated after the approval from @sundararajana, seconds before this comment.

That's alright.

What is the best action here, just have a rollback PR ready in case of failures?

Typically when such failures happen, depending on the noise it creates in the CI, the change is either backed out https://openjdk.org/guide/#backing-out-a-change or a JBS issue is created to fix the issue, leaving the original change around. We don't need to do anything for now. I'll keep a watch on the test run.

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

Successfully merging this pull request may close these issues.

3 participants