This is an automated email from the ASF dual-hosted git repository. rfscholte pushed a commit to branch MNG-4660 in repository https://gitbox.apache.org/repos/asf/maven-integration-testing.git
commit f3e1e4016c3ca363fffe9e89ce88fc8345ff7ec3 Author: Maarten Mulders <[email protected]> AuthorDate: Tue Apr 7 21:29:38 2020 +0200 Share a bit more context why we're doing the ugly Thread.sleep --- .../maven/it/MavenITmng4660OutdatedPackagedArtifact.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4660OutdatedPackagedArtifact.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4660OutdatedPackagedArtifact.java index 983a112..afc46de 100644 --- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4660OutdatedPackagedArtifact.java +++ b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4660OutdatedPackagedArtifact.java @@ -63,10 +63,13 @@ public class MavenITmng4660OutdatedPackagedArtifact extends AbstractMavenIntegra verifier1.assertFilePresent( module1Jar.toString() ); verifier1.resetStreams(); - // Simulating the delay between two invocations. It also makes sure we're not hit by tests that run so fast, - // that the difference in file modification time (see below) is too small to observe. Some combinations of OS - // and filesystem return that value with "just" second precision, which is not detailed enough. - Thread.sleep(1_000); + if ( System.getProperty( "java.version", "" ).startsWith( "1." ) ) + { + // Simulating the delay between two invocations. It also makes sure we're not hit by tests that run so fast, + // that the difference in file modification time (see below) is too small to observe. Java 8 on Linux and + // macOS returns that value with "just" second precision, which is not detailed enough. + Thread.sleep( 1_000 ); + } // 2. Create a properties file with some content and compile only that module (module A). final Verifier verifier2 = newVerifier( testDir.getAbsolutePath() );
