Fix the way unit tests modify the timestamp of a file#77
Closed
plamentotev wants to merge 1 commit intocodehaus-plexus:masterfrom
plamentotev:fix-tests-file-timestamp
Closed
Fix the way unit tests modify the timestamp of a file#77plamentotev wants to merge 1 commit intocodehaus-plexus:masterfrom plamentotev:fix-tests-file-timestamp
plamentotev wants to merge 1 commit intocodehaus-plexus:masterfrom
plamentotev:fix-tests-file-timestamp
Conversation
Author
|
Hmm interesting. The Travis builds are failing but my local builds (Windows and Linux) are ok. Looks like I need to investigate it a bit more. |
Member
|
I have restarted the build... |
Member
|
Hi Plamen, cause you have to try it upgrade maven-surefire plugin to 2.20.1 ? |
Author
|
Hi,
I think I found the issue. Travis is running on AWS and was able to
reproduce it on AWS virtual machine. The files are created with
timestamp earlier than System.currentTimeMillis() so I have to find a
better way to ensure that newly created file will have newer timestamp.
…On 1/11/2018 10:53 PM, Karl Heinz Marbaise wrote:
Hi Plamen, cause you have to try it upgrade maven-surefire plugin to
2.20.1 ?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#77 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AMLobe5un8XbB2LprHBvyjgofU3pPPmZks5tJnS8gaJpZM4RbRzc>.
|
The current approach is to copy the file until it gets a timestamp newer than a given reference value. Java 7 provides a better method to modify a file timestamp - `Files.setLastModifiedTime`. Use it instead the current approach. Not only it is better suited for the task, but Plexus Utils 3.1.0 no longer updates the timestamp of copied files and the current approach is no longer working one - the tests are running in endless loop.
Author
|
Yep, that did the trick :) |
Member
|
That looks good..ready from your side for integration? |
Author
|
Yep, I'll integrate it in master. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The current approach is to copy the file until it gets a timestamp newer than a given reference value.
Java 7 provides a better method to modify a file timestamp -
Files.setLastModifiedTime. Use it instead the current approach. Not only it is better suited for the task, but Plexus Utils 3.1.0 no longer updates the timestamp of copied files and the current approach is no longer working one - the tests are running in endless loop.