You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by GitBox <gi...@apache.org> on 2022/07/12 08:51:19 UTC

[GitHub] [commons-configuration] robtimus commented on a diff in pull request #194: CONFIGURATION-817: update to JUnit 5

robtimus commented on code in PR #194:
URL: https://github.com/apache/commons-configuration/pull/194#discussion_r918716856


##########
src/test/java/org/apache/commons/configuration2/TestDynamicCombinedConfiguration.java:
##########
@@ -198,6 +198,8 @@ public static void setUpOnce() {
 
     private void copyFile(final File input, final File output) throws IOException {
         FileUtils.copyFile(input, output, StandardCopyOption.REPLACE_EXISTING);
+        // On Windows, the last modified time is copied by default. Change the last modified time manually.
+        output.setLastModified(System.currentTimeMillis());

Review Comment:
   After my changes the one test that used this method failed. I couldn't find out why my changes would have caused this, so I ran the tests on master again; the test failed there as well.
   
   I started debugging the code, and noticed that the last modified timestamp wasn't changed. This is commented in FileUtils: https://github.com/apache/commons-io/blob/rel/commons-io-2.11.0/src/main/java/org/apache/commons/io/FileUtils.java#L849. The test clearly needed the last modified timestamp to change, something that was probably done automatically on Linux but on Windows it needed this extra step.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org