You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuweni.apache.org by to...@apache.org on 2019/05/20 03:49:13 UTC
[incubator-tuweni] 01/09: Make sure the test doesn't fail if the
file doesn't exist yet
This is an automated email from the ASF dual-hosted git repository.
toulmean pushed a commit to branch 0.7
in repository https://gitbox.apache.org/repos/asf/incubator-tuweni.git
commit 0526a7b256147a79e88e32d7a1022146099c6ef4
Author: Antoine Toulme <an...@lunar-ocean.com>
AuthorDate: Fri May 10 11:14:53 2019 -0700
Make sure the test doesn't fail if the file doesn't exist yet
---
.../test/java/org/apache/tuweni/gossip/GossipIntegrationTest.java | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/gossip/src/test/java/org/apache/tuweni/gossip/GossipIntegrationTest.java b/gossip/src/test/java/org/apache/tuweni/gossip/GossipIntegrationTest.java
index 7ff14d0..8a0e31f 100644
--- a/gossip/src/test/java/org/apache/tuweni/gossip/GossipIntegrationTest.java
+++ b/gossip/src/test/java/org/apache/tuweni/gossip/GossipIntegrationTest.java
@@ -22,6 +22,7 @@ import org.apache.tuweni.junit.*;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
+import java.util.Collections;
import java.util.List;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
@@ -103,13 +104,15 @@ class GossipIntegrationTest {
}).end(Buffer.buffer(Bytes32.rightPad(Bytes.ofUnsignedInt(i)).toHexString().getBytes(StandardCharsets.UTF_8)));
}
- List<String> receiver1 = null;
+ List<String> receiver1 = Collections.emptyList();
int counter = 0;
do {
Thread.sleep(1000);
counter++;
- receiver1 = Files.readAllLines(tempDir.resolve("log2.log"));
+ if (Files.exists(tempDir.resolve("log2.log"))) {
+ receiver1 = Files.readAllLines(tempDir.resolve("log2.log"));
+ }
} while (receiver1.size() < 20 && counter < 20);
client.close();
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@tuweni.apache.org
For additional commands, e-mail: commits-help@tuweni.apache.org