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

8334339: Test java/nio/file/attribute/BasicFileAttributeView/CreationTime.java fails on alinux3 #19737

Closed
wants to merge 10 commits into from

Conversation

sendaoYan
Copy link
Member

@sendaoYan sendaoYan commented Jun 16, 2024

Hi all,
The testcase java/nio/file/attribute/BasicFileAttributeView/CreationTime.java fails on alinux3(alibaba cloud linux version 3) after JDK-8316304.
The testcase use /tmp directory to create the file and get the createtime(birth time) of this file. But on alinux3(alibaba cloud linux version 3), the /tmp is mount as tmpfs, it's not a real physic disk paitition, it's mount from RAM, and the alinux3 doesn't support get the birth time on tmpfs.
On ubuntu 22, when I create a file on /dev/shm(it's also a tmpfs type partition), stat also doesn't support birth time.
According to the Java API doc, If the file system implementation does not support a time stamp to indicate the time when the file was created, the creationTime() API return the epoch (1970-01-01T00:00:00Z).

So in this PR, if the test directory(on linux the test directory is /tmp) doesn't support birth time, the test throw a jtreg.SkippedException, rather than report a failure.
And in this PR, I create a new test, change the test directory from /tmp to pwd, which the current work directory maybe at diffrent partition to /tmp, and the current work directory support birth time possibly.

The change has been verified on below env:

  • alinux3 run test CreationTime.java
  • windows run test CreationTime.java

windows-CreationTime.java.log
alinux3-CreationTime.java.log


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-8334339: Test java/nio/file/attribute/BasicFileAttributeView/CreationTime.java fails on alinux3 (Bug - P3)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 19737

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

Using diff file

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

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Jun 16, 2024

👋 Welcome back syan! 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 Jun 16, 2024

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

8334339: Test java/nio/file/attribute/BasicFileAttributeView/CreationTime.java fails on alinux3

Reviewed-by: alanb

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

  • 7e55ed3: 8333748: javap crash - Fatal error: Unmatched bit position 0x2 for location CLASS
  • 1ff5acd: 8332099: since-checker - Add @ since to package-info in jdk.jsobject
  • 689cee3: 8334509: Cancelling PageDialog does not return the same PageFormat object
  • 8e1d2b0: 8334441: Mark tests in jdk_security_infra group as manual
  • 93d9802: 8334715: [riscv] Mixed use of tab and whitespace in riscv.ad
  • c41293a: 8334695: Fix build failure without zgc after JDK-8333300
  • 75bea28: 8333867: SHA3 performance can be improved
  • 9f8de22: 8327793: Deprecate jstatd for removal
  • dbf5a9a: 8334706: [JVMCI] APX registers incorrectly exposed on AMD64
  • 08ace27: 8332314: Add window size configuration option to JavaShellToolBuilder interface
  • ... and 63 more: https://git.openjdk.org/jdk/compare/8464ce6db5cbd5d50ac2a2bcba905b7255f510f5...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 (@AlanBateman) 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 rfr Pull request is ready for review label Jun 16, 2024
@openjdk
Copy link

openjdk bot commented Jun 16, 2024

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

  • nio

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 nio nio-dev@openjdk.org label Jun 16, 2024
@mlbridge
Copy link

mlbridge bot commented Jun 16, 2024

Webrevs

@openjdk openjdk bot removed the rfr Pull request is ready for review label Jun 16, 2024
@openjdk openjdk bot added the rfr Pull request is ready for review label Jun 16, 2024
@sendaoYan
Copy link
Member Author

/issue JDK-8334339

@sendaoYan sendaoYan changed the title 8334339: CreationTime.java fails on alinux3 8334339: Test java/nio/file/attribute/BasicFileAttributeView/CreationTime.java fails on alinux3 Jun 17, 2024
@openjdk
Copy link

openjdk bot commented Jun 17, 2024

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

@AlanBateman
Copy link
Contributor

Would it be possible to say what Files.getFileStore(file).type() returns? The test has an existing method to skip and I'm wonder if that could be used rather than introducing another.

@sendaoYan
Copy link
Member Author

sendaoYan commented Jun 17, 2024

Would it be possible to say what Files.getFileStore(file).type() returns? The test has an existing method to skip and I'm wonder if that could be used rather than introducing another.

Files.getFileStore(file).type() returns tmpfs. But does it possible that the linux kernel can support birth time for tmpfstype files in future. I think it is more accurate to use the stat command to determine whether a file supports birth time than to obtain the file type throuht Files.getFileStore(file).type().

In some situation, the ext4 file type doesn't support birth time, so use Files.getFileStore(file).type() determine whether a file support birth time or not is not quite accurate.

@AlanBateman
Copy link
Contributor

In some situation, the ext4 file type doesn't support birth time, so use Files.getFileStore(file).type() determine whether a file support birth time or not is not quite accurate.

The concern with forking stat is that it complicates the test and creates more things to go wrong. If the change could be reduced to just skipping when the creation time is 0 then I think it should be okay.

@sendaoYan
Copy link
Member Author

The concern with forking stat is that it complicates the test and creates more things to go wrong. If the change could be reduced to just skipping when the creation time is 0 then I think it should be okay.

Thanks for the review, the stat fork has been deleted.

Copy link
Contributor

@AlanBateman AlanBateman left a comment

Choose a reason for hiding this comment

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

I think this is okay. Yes it means that the test will pass if the the epoch is returned for the file creation time but it keeps the test simple.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Jun 22, 2024
@sendaoYan
Copy link
Member Author

Thanks for the review and suggestions.
/integrate

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

openjdk bot commented Jun 22, 2024

@sendaoYan
Your change (at version fce6c98) is now ready to be sponsored by a Committer.

@sendaoYan
Copy link
Member Author

The GHA test runner report a intermitent failure, I has created a issue to record this failure. It's unrelated to this PR.

@AlanBateman
Copy link
Contributor

The GHA test runner report a intermitent failure, I has created a issue to record this failure. It's unrelated to this PR.

Okay, but just to say that the tests for this are in tier2 so not run by the GHA.

@AlanBateman
Copy link
Contributor

/sponsor

@openjdk
Copy link

openjdk bot commented Jun 23, 2024

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

  • eb110bd: 8334180: NMT gtests introduced with 8312132 should be labeled as NMT
  • 652784c: 8334392: Switch RNG in NMT's treap
  • 72ca7ba: 8334708: FFM: two javadoc problems
  • 7e55ed3: 8333748: javap crash - Fatal error: Unmatched bit position 0x2 for location CLASS
  • 1ff5acd: 8332099: since-checker - Add @ since to package-info in jdk.jsobject
  • 689cee3: 8334509: Cancelling PageDialog does not return the same PageFormat object
  • 8e1d2b0: 8334441: Mark tests in jdk_security_infra group as manual
  • 93d9802: 8334715: [riscv] Mixed use of tab and whitespace in riscv.ad
  • c41293a: 8334695: Fix build failure without zgc after JDK-8333300
  • 75bea28: 8333867: SHA3 performance can be improved
  • ... and 66 more: https://git.openjdk.org/jdk/compare/8464ce6db5cbd5d50ac2a2bcba905b7255f510f5...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Jun 23, 2024

@AlanBateman @sendaoYan Pushed as commit 7baddc2.

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

@sendaoYan sendaoYan deleted the jbs8334339 branch June 24, 2024 03:06
@sendaoYan
Copy link
Member Author

Thanks for the sponsor.

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 nio nio-dev@openjdk.org
Development

Successfully merging this pull request may close these issues.

2 participants