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

7902698: Collision of zero timestamp as a special value with use in filesystems #22

Closed
wants to merge 3 commits into from

Conversation

cushon
Copy link
Contributor

@cushon cushon commented Jan 20, 2022

This fixes a bug when the timestamp of a test file is set to zero, since jtharness currently uses zero as a special value. See discussion in CODETOOLS-7902698.


Progress

  • Change must not contain extraneous whitespace

Issue

  • CODETOOLS-7902698: Collision of zero timestamp as a special value with use in filesystems

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jtharness pull/22/head:pull/22
$ git checkout pull/22

Update a local copy of the PR:
$ git checkout pull/22
$ git pull https://git.openjdk.java.net/jtharness pull/22/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 22

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.java.net/jtharness/pull/22.diff

@bridgekeeper
Copy link

bridgekeeper bot commented Jan 20, 2022

👋 Welcome back cushon! 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 Jan 20, 2022

@cushon This change now passes all automated pre-integration checks.

After integration, the commit message for the final commit will be:

7902698: Collision of zero timestamp as a special value with use in filesystems

Reviewed-by: dbessono

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

  • 586965e: 7903079: Feature Tests - Adding six JavaTest GUI legacy automated test scripts
  • 3d72bd1: 7903076: Feature Tests - Adding five JavaTest GUI legacy automated feature test scripts

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.

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 (@dbessono) 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 ready Pull request is ready to be integrated rfr Pull request is ready for review labels Jan 20, 2022
@mlbridge
Copy link

mlbridge bot commented Jan 20, 2022

Webrevs

Copy link
Collaborator

@dbessono dbessono left a comment

Choose a reason for hiding this comment

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

It seems that previously zero default value served as "undefined yet" for these fields, now switched to "-1" as their default value. However 'URLConnection::getLastModified' returns "0 if not known" and 'File::lastModified' spec asserts: "returns 0L if the file does not exist or if an I/O error occurs. The value may be negative indicating the number of milliseconds before the epoch".

It possibly would be more reliable and readable to switch types of these fields from 'long' to OptionalLong with OptionalLong.empty() as their default value.

@cushon
Copy link
Contributor Author

cushon commented Jan 25, 2022

Thanks for the review!

It possibly would be more reliable and readable to switch types of these fields from 'long' to OptionalLong with OptionalLong.empty() as their default value.

Done

@@ -903,7 +904,7 @@ public synchronized boolean refreshIfNeeded() {

// may be less than if the custom finder starts to return a
// bogus value - like zero or 1 for whatever reason
if (thisScanDate <= lastScanDate) {
if (lastScanDate.isEmpty() || thisScanDate <= lastScanDate.getAsLong()) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Likely the same thing here, the mentioned SelectionTest passes with

            if (lastScanDate.isPresent() && thisScanDate <= lastScanDate.getAsLong() ) {
                return false;
            }

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

Copy link
Collaborator

@dbessono dbessono left a comment

Choose a reason for hiding this comment

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

seeing a failure of com.sun.javatest.SelectionTest regression test... inlined comments on the possible changes

@cushon cushon requested a review from dbessono February 2, 2022 22:43
@cushon
Copy link
Contributor Author

cushon commented Feb 3, 2022

/integrate

@openjdk openjdk bot added the sponsor Pull request requires a sponsor label Feb 3, 2022
@openjdk
Copy link

openjdk bot commented Feb 3, 2022

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

@dbessono
Copy link
Collaborator

dbessono commented Feb 3, 2022

/sponsor

@openjdk
Copy link

openjdk bot commented Feb 3, 2022

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

  • 586965e: 7903079: Feature Tests - Adding six JavaTest GUI legacy automated test scripts
  • 3d72bd1: 7903076: Feature Tests - Adding five JavaTest GUI legacy automated feature test scripts

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Feb 3, 2022
@openjdk openjdk bot closed this Feb 3, 2022
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review sponsor Pull request requires a sponsor labels Feb 3, 2022
@openjdk
Copy link

openjdk bot commented Feb 3, 2022

@dbessono @cushon Pushed as commit 6e1a709.

💡 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
integrated Pull request has been integrated
Development

Successfully merging this pull request may close these issues.

None yet

2 participants