You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by rf...@apache.org on 2020/04/07 20:24:32 UTC
[maven-integration-testing] 23/24: Add small delay between two
Verifier invocations.
This is an automated email from the ASF dual-hosted git repository.
rfscholte pushed a commit to branch MGN-4660
in repository https://gitbox.apache.org/repos/asf/maven-integration-testing.git
commit 7faa0a8d0b1a2161b592cb4ad3409681076a5e28
Author: Maarten Mulders <ma...@infosupport.com>
AuthorDate: Tue Apr 7 19:35:40 2020 +0200
Add small delay between two Verifier invocations.
It also makes sure we're not hit by tests that run so fast, that the
difference in file modification time is too small to observe. Some
combinations of Java version, OS and filesystem return that value
with "just" second precision, which is not detailed enough.
---
.../org/apache/maven/it/MavenITmng4660OutdatedPackagedArtifact.java | 5 +++++
1 file changed, 5 insertions(+)
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 ea8100f..983a112 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,6 +63,11 @@ 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);
+
// 2. Create a properties file with some content and compile only that module (module A).
final Verifier verifier2 = newVerifier( testDir.getAbsolutePath() );
final Path resourcesDirectory = Files.createDirectories( Paths.get( testDir.toString(), "module-a", "src", "main", "resources" ) );