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

8290180: Convert com/sun/management/UnixOperatingSystemMXBean/GetOpenFileDescriptorCount.sh to jtreg java version #9503

Closed
wants to merge 5 commits into from

Conversation

bwhuang-us
Copy link
Contributor

@bwhuang-us bwhuang-us commented Jul 14, 2022

This is a task to convert shell tests to Java tests. The shell scripts to be removed are responsible for compiling Java files and running the tests on Linux systems. This functionality can be achieved with JTReg tag @requires (os.family=="linux").


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

Issues

  • JDK-8290180: Convert com/sun/management/UnixOperatingSystemMXBean/GetOpenFileDescriptorCount.sh to jtreg java version
  • JDK-8290181: convert com/sun/management/UnixOperatingSystemMXBean/GetMaxFileDescriptorCount.sh to java version

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 9503

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

Using diff file

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

@bridgekeeper
Copy link

bridgekeeper bot commented Jul 14, 2022

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

@bwhuang-us
Copy link
Contributor Author

/issue JDK-8290180

@bwhuang-us
Copy link
Contributor Author

/issue add JDK-8290181

@openjdk openjdk bot added the rfr Pull request is ready for review label Jul 14, 2022
@openjdk
Copy link

openjdk bot commented Jul 14, 2022

@bwhuang-us This issue is referenced in the PR title - it will now be updated.

@openjdk
Copy link

openjdk bot commented Jul 14, 2022

@bwhuang-us
Adding additional issue to issue list: 8290181: convert com/sun/management/UnixOperatingSystemMXBean/GetMaxFileDescriptorCount.sh to java version.

@openjdk
Copy link

openjdk bot commented Jul 14, 2022

@bwhuang-us The following labels will be automatically applied to this pull request:

  • jmx
  • serviceability

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

@openjdk openjdk bot added serviceability serviceability-dev@openjdk.org jmx jmx-dev@openjdk.org labels Jul 14, 2022
@mlbridge
Copy link

mlbridge bot commented Jul 14, 2022

Webrevs

* @bug 4858522
* @summary Basic unit test of UnixOperatingSystemMXBean.getMaxFileDescriptorCount()
* @author Steve Bohne
* @requires (os.family=="linux")
Copy link
Member

Choose a reason for hiding this comment

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

please add spaces, braces are not required, see examples in jtreg tests
@requires os.family == "linux"

* @bug 4858522
* @summary Basic unit test of UnixOperatingSystemMXBean.getMaxFileDescriptorCount()
* @author Steve Bohne
* @requires (os.family=="linux")
*
* @run main/othervm GetMaxFileDescriptorCount
Copy link
Member

Choose a reason for hiding this comment

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

is othervm required here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, it is not needed. I will remove it.

@openjdk
Copy link

openjdk bot commented Jul 14, 2022

@bwhuang-us 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:

8290180: Convert com/sun/management/UnixOperatingSystemMXBean/GetOpenFileDescriptorCount.sh to jtreg java version
8290181: convert com/sun/management/UnixOperatingSystemMXBean/GetMaxFileDescriptorCount.sh to java version

Reviewed-by: lmesnik, amenkov

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

  • ea8b75c: 8290334: Update FreeType to 2.12.1
  • 6882f0e: 8290013: serviceability/jvmti/GetLocalVariable/GetLocalWithoutSuspendTest.java failed "assert(!in_vm) failed: Undersized StackShadowPages"
  • 92067e2: 8290137: riscv: small refactoring for add_memory_int32/64
  • 87340fd: 8288883: C2: assert(allow_address || t != T_ADDRESS) failed after JDK-8283091
  • bc7a1ea: 8288948: Few J2DBench tests indicate lower primitive drawing performance with metal rendering pipeline
  • 84f2314: 8286030: Avoid JVM crash when containers share the same /tmp dir
  • 4dd236b: 8290280: riscv: Clean up stack and register handling in interpreter
  • 522b657: Merge
  • 15d3329: 8281969: Bad result for the snippet @link tag if substring/regex consists of whitespace
  • c8e0315: 8290250: Shenandoah: disable Loom for iu mode
  • ... and 35 more: https://git.openjdk.org/jdk/compare/c83fcbd18fff4d10c4162c43ddcdf3a51ce2c8e6...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 (@lmesnik, @alexmenkov) 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 openjdk bot added the ready Pull request is ready to be integrated label Jul 14, 2022
@lmesnik
Copy link
Member

lmesnik commented Jul 14, 2022

There are some possible cleanups in the tests (comments, unused args, variable name style) but seem out of scope for this PR.

@bwhuang-us
Copy link
Contributor Author

It is not out of scope. I can do the clean up along with this PR. Can you please give me some hints what could be optimized?

@lmesnik
Copy link
Member

lmesnik commented Jul 14, 2022

The variables should use camelCase. Like min_count_for_pass -> minCountForPass
Variable trace not needed, just print count always
The mention of Solaris should be removed from comments, also I don't know if instructions for manual testing are needed, but it would be better to say "to know actual value run smth".

@dholmes-ora
Copy link
Member

Is the restriction to run on Linux actually still valid? Shouldn't this work on any of our Posix-like platforms? I suspect you need to read "Linux" as "not Solaris or Windows" when looking at this test (and possibly others).

@bwhuang-us
Copy link
Contributor Author

@dholmes-ora I agreed. These tests should be working on any unix-based system. I can change the restriction to be not Windows. The other question is should we include Solaris as it is also unix based.

@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Jul 15, 2022
@bwhuang-us
Copy link
Contributor Author

bwhuang-us commented Jul 15, 2022

@lmesnik I've completely removed the comments for manual tests because I don't think manual tests are necessary in this scenario. If the purpose of the manual tests is to compare FD count from the Java API to the system properties, it can be done in automated ways. Potential test cases could be opening a new file and observing increment to the opened FD count, or checking the value from the system call, etc. We can address this in a separate ticket if we want.

@openjdk openjdk bot added ready Pull request is ready to be integrated rfr Pull request is ready for review labels Jul 15, 2022
@alexmenkov
Copy link

Still good to me

@dholmes-ora
Copy link
Member

The other question is should we include Solaris as it is also unix based.

@bwhuang-us there is no Solaris support in mainline.

@bwhuang-us
Copy link
Contributor Author

/integrate

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

openjdk bot commented Jul 18, 2022

@bwhuang-us
Your change (at version fed0b27) is now ready to be sponsored by a Committer.

@lmesnik
Copy link
Member

lmesnik commented Aug 8, 2022

/sponsor

@openjdk
Copy link

openjdk bot commented Aug 8, 2022

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

  • 4591937: 8290357: Drop HeapRegion::marked_bytes()
  • 7676be8: 8291037: Move PLAB resizing mechanism to G1EvacStats
  • 861cc67: 8291897: TerminatingThreadLocal(s) not registered from virtual thread(s)
  • 8d88be2: 8291459: JVM crash with GenerateOopMap::error_work(char const*, __va_list_tag*)
  • 8a804f6: 8291454: Missing check for JLI C runtime library in CoreLibraries.gmk
  • 5a539e8: 8291893: riscv: remove fence.i used in user space
  • b2f0cbd: 8064787: [macosx] In Nimbus LaF, Ctrl+Alt mnemonic doesn't work
  • 891df21: 8259687: JTabbedPane.setComponentAt doesn't hide previously visible tab component
  • d4fb91b: 8291956: Simplify the loop condition in sun.net.httpserver.Request constructor
  • 20123ea: 8291901: IGV: Preference menu disappears after JDK-8288750
  • ... and 284 more: https://git.openjdk.org/jdk/compare/c83fcbd18fff4d10c4162c43ddcdf3a51ce2c8e6...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Aug 8, 2022
@openjdk openjdk bot closed this Aug 8, 2022
@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 Aug 8, 2022
@openjdk
Copy link

openjdk bot commented Aug 8, 2022

@lmesnik @bwhuang-us Pushed as commit 124fc4a.

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

@bwhuang-us bwhuang-us deleted the JDK-8290180 branch March 1, 2023 18:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integrated Pull request has been integrated jmx jmx-dev@openjdk.org serviceability serviceability-dev@openjdk.org
4 participants