Skip to content

Conversation

@Vanitha-bp
Copy link
Contributor

@Vanitha-bp Vanitha-bp commented Jun 4, 2024

Created jtreg test case for JDK-8325203 issue.

The JpackageTest created tests that the child process started from the app launched by jpackage launcher is not automatically terminated when the the launcher is terminated.


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-8325525: Create jtreg test case for JDK-8325203 (Enhancement - P4)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 19536

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

Using diff file

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

Webrev

Link to Webrev Comment

@bridgekeeper bridgekeeper bot added the oca Needs verification of OCA signatory status label Jun 4, 2024
@bridgekeeper
Copy link

bridgekeeper bot commented Jun 4, 2024

Hi @Vanitha-bp, welcome to this OpenJDK project and thanks for contributing!

We do not recognize you as Contributor and need to ensure you have signed the Oracle Contributor Agreement (OCA). If you have not signed the OCA, please follow the instructions. Please fill in your GitHub username in the "Username" field of the application. Once you have signed the OCA, please let us know by writing /signed in a comment in this pull request.

If you already are an OpenJDK Author, Committer or Reviewer, please click here to open a new issue so that we can record that fact. Please use "Add GitHub user Vanitha-bp" as summary for the issue.

If you are contributing this work on behalf of your employer and your employer has signed the OCA, please let us know by writing /covered in a comment in this pull request.

@openjdk
Copy link

openjdk bot commented Jun 4, 2024

@Vanitha-bp 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:

8325525: Create jtreg test case for JDK-8325203

Reviewed-by: asemenyuk, almatvee

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

  • b363de8: 8335946: DTrace code snippets should be generated when DTrace flags are enabled
  • d6c6847: 8335743: jhsdb jstack cannot print some information on the waiting thread
  • cad68e0: 8335935: Chained builders not sending transformed models to next transforms
  • 242f113: 8334481: [JVMCI] add LINK_TO_NATIVE to MethodHandleAccessProvider.IntrinsicMethod
  • 66db715: 8335637: Add explicit non-null return value expectations to Object.toString()
  • 7ab96c7: 8335409: Can't allocate and retain memory from resource area in frame::oops_interpreted_do oop closure after 8329665
  • fb66716: 8331725: ubsan: pc may not always be the entry point for a VtableStub
  • fb9a227: 8313909: [JVMCI] assert(cp->tag_at(index).is_unresolved_klass()) in lookupKlassInPool
  • e6c5aa7: 8336012: Fix usages of jtreg-reserved properties
  • e0fb949: 8335779: JFR: Hide sleep events
  • ... and 440 more: https://git.openjdk.org/jdk/compare/ca3072635215755766575b4eb70dc6267969a550...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.

As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@alexeysemenyukoracle, @sashamatveev) but any other Committer may sponsor as well.

➡️ To flag this PR as ready for integration with the above commit message, type /integrate in a new comment. (Afterwards, your sponsor types /sponsor in a new comment to perform the integration).

@openjdk
Copy link

openjdk bot commented Jun 4, 2024

@Vanitha-bp 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 Jun 4, 2024
@Vanitha-bp
Copy link
Contributor Author

/covered

@bridgekeeper bridgekeeper bot added the oca-verify Needs verification of OCA signatory status label Jun 5, 2024
@bridgekeeper
Copy link

bridgekeeper bot commented Jun 5, 2024

Thank you! Please allow for a few business days to verify that your employer has signed the OCA. Also, please note that pull requests that are pending an OCA check will not usually be evaluated, so your patience is appreciated!

@bridgekeeper bridgekeeper bot removed oca Needs verification of OCA signatory status oca-verify Needs verification of OCA signatory status labels Jun 13, 2024
@openjdk openjdk bot added the rfr Pull request is ready for review label Jun 13, 2024
@mlbridge
Copy link

mlbridge bot commented Jun 13, 2024

Webrevs

@alexeysemenyukoracle
Copy link
Member

alexeysemenyukoracle commented Jun 20, 2024

The test builds an installer that must be installed as a part of the test. This will not work in an environment where tests are executed under a user account with restricted permissions. Building app image instead of an installer is sufficient for this test.

There are helper classes for writing jpackage tests in https://github.com/openjdk/jdk/tree/master/test/jdk/tools/jpackage/helpers/jdk/jpackage/test folder.

I'd not use a file to communicate PID of the started process between the launcher and the test. I'd use stdout instead:

public class ThirdPartyAppLauncher {
    public static void main(String[] args) throws IOException {
        Process process = new ProcessBuilder("regedit").start();
        System.out.println("RegEdit PID=" + process.pid());
    }
}

Compiling, jarring, and running jpackage that will create app image from the jar with these helpers would be as follows:

JPackageCommand.helloAppImage(TKit.TEST_SRC_ROOT.resolve("apps/ThirdPartyAppLauncher.java") + "*Hello").executeAndAssertImageCreated();

Then you run "ThirdPartyAppLauncher" class using jpackage launcher and capture its stdout:

String pidStr = new Executor().saveOutput().dumpOutput().setExecutable(cmd.appLauncherPath().toAbsolutePath()).execute(0).getFirstLineOfOutput();

// parse regedit PID
long regeditPid = Long.parseLong(pidStr.split("=", 2)[1]);

// Run your checks
...

// Kill only a specific regedit instance
Runtime.getRuntime().exec("taskkill /F /PID " + regeditPid);

You may use one of the existing jpackage tests for the reference (https://github.com/openjdk/jdk/blob/master/test/jdk/tools/jpackage/share/AppLauncherEnvTest.java is a good example)

@Vanitha-bp
Copy link
Contributor Author

Thanks for the inputs @alexeysemenyukoracle. I have addressed the review comments.

Copy link
Member

@sashamatveev sashamatveev left a comment

Choose a reason for hiding this comment

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

Looks good.

@openjdk
Copy link

openjdk bot commented Jul 9, 2024

⚠️ @Vanitha-bp the full name on your profile does not match the author name in this pull requests' HEAD commit. If this pull request gets integrated then the author name from this pull requests' HEAD commit will be used for the resulting commit. If you wish to push a new commit with a different author name, then please run the following commands in a local repository of your personal fork:

$ git checkout 8325525
$ git commit --author='Preferred Full Name <you@example.com>' --allow-empty -m 'Update full name'
$ git push

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Jul 9, 2024
@alexeysemenyukoracle
Copy link
Member

Looks good. Thank you for doing all the adjustments to the code!

@Vanitha-bp
Copy link
Contributor Author

Vanitha-bp commented Jul 11, 2024

Thanks @alexeysemenyukoracle and @sashamatveev for reviewing and providing valuable inputs. Please sponsor the changes.

@Vanitha-bp
Copy link
Contributor Author

/integrate

@openjdk openjdk bot added the sponsor Pull request is ready to be sponsored label Jul 11, 2024
@openjdk
Copy link

openjdk bot commented Jul 11, 2024

@Vanitha-bp
Your change (at version 889c5d7) is now ready to be sponsored by a Committer.

@alexeysemenyukoracle
Copy link
Member

/integrate

@openjdk
Copy link

openjdk bot commented Jul 11, 2024

@alexeysemenyukoracle Only the author (@Vanitha-bp) is allowed to issue the integrate command. As this pull request is ready to be sponsored, and you are an eligible sponsor, did you mean to issue the /sponsor command?

@alexeysemenyukoracle
Copy link
Member

/sponsor

@openjdk
Copy link

openjdk bot commented Jul 11, 2024

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

  • b3ef2a6: 8336036: Synthetic documentation for a record's equals is incorrect for floating-point types
  • 687601e: 8336257: Additional tests in jmxremote/startstop to match on PID not app name
  • 8890557: 8335623: Clean up HtmlTag.HtmlTag and make the ARIA role attribute global
  • 73e3e0e: 8321509: False positive in get_trampoline fast path causes crash
  • 9eb611e: 8334055: Unhelpful 'required: reference' diagnostics after JDK-8043226
  • 5100303: 8335668: NumberFormat integer only parsing should throw exception for edge case
  • 58c9842: 8336021: Doccheck: valign not allowed for HTML5 in java.xml
  • d06d79c: 8325369: @sealedGraph: Bad link to image for tag on nested classes
  • dea9274: 8332125: [nmt] Totals in diff report should print out total malloc and mmap diffs
  • 5c612c2: 8332689: RISC-V: Use load instead of trampolines
  • ... and 457 more: https://git.openjdk.org/jdk/compare/ca3072635215755766575b4eb70dc6267969a550...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Jul 11, 2024

@alexeysemenyukoracle @Vanitha-bp Pushed as commit 81a0d1b.

💡 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

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