From d47a3c3e5b8ce7b48b675a34b5f43218c888ec4a Mon Sep 17 00:00:00 2001
From: akwizgran <akwizgran@users.sourceforge.net>
Date: Wed, 28 Mar 2012 23:42:41 +0100
Subject: [PATCH] Increased some timeouts to stop tests from failing under
 load.

---
 .../plugins/file/PollingRemovableDriveMonitorTest.java      | 2 +-
 .../briar/plugins/file/UnixRemovableDriveMonitorTest.java   | 2 +-
 .../net/sf/briar/plugins/socket/SimpleSocketPluginTest.java | 4 ++--
 test/net/sf/briar/plugins/tor/TorPluginTest.java            | 6 +++---
 4 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/test/net/sf/briar/plugins/file/PollingRemovableDriveMonitorTest.java b/test/net/sf/briar/plugins/file/PollingRemovableDriveMonitorTest.java
index f2d7a65dfc..cc9e4f5dda 100644
--- a/test/net/sf/briar/plugins/file/PollingRemovableDriveMonitorTest.java
+++ b/test/net/sf/briar/plugins/file/PollingRemovableDriveMonitorTest.java
@@ -50,7 +50,7 @@ public class PollingRemovableDriveMonitorTest extends BriarTestCase {
 				Executors.newCachedThreadPool(), finder, 10);
 		monitor.start(callback);
 		// Wait for the monitor to detect the files
-		assertTrue(latch.await(1, TimeUnit.SECONDS));
+		assertTrue(latch.await(5, TimeUnit.SECONDS));
 		monitor.stop();
 		// Check that both files were detected
 		assertEquals(2, detected.size());
diff --git a/test/net/sf/briar/plugins/file/UnixRemovableDriveMonitorTest.java b/test/net/sf/briar/plugins/file/UnixRemovableDriveMonitorTest.java
index d03570621f..ae3393a548 100644
--- a/test/net/sf/briar/plugins/file/UnixRemovableDriveMonitorTest.java
+++ b/test/net/sf/briar/plugins/file/UnixRemovableDriveMonitorTest.java
@@ -64,7 +64,7 @@ public class UnixRemovableDriveMonitorTest extends BriarTestCase {
 		assertTrue(file1.createNewFile());
 		assertTrue(file2.createNewFile());
 		// Wait for the monitor to detect the files
-		assertTrue(latch.await(1, TimeUnit.SECONDS));
+		assertTrue(latch.await(5, TimeUnit.SECONDS));
 		monitor.stop();
 		// Check that both files were detected
 		assertEquals(2, detected.size());
diff --git a/test/net/sf/briar/plugins/socket/SimpleSocketPluginTest.java b/test/net/sf/briar/plugins/socket/SimpleSocketPluginTest.java
index 23e6381103..bf5d6f15fc 100644
--- a/test/net/sf/briar/plugins/socket/SimpleSocketPluginTest.java
+++ b/test/net/sf/briar/plugins/socket/SimpleSocketPluginTest.java
@@ -34,7 +34,7 @@ public class SimpleSocketPluginTest extends BriarTestCase {
 		SimpleSocketPlugin plugin = new SimpleSocketPlugin(e, callback, 0L);
 		plugin.start();
 		// The plugin should have bound a socket and stored the port number
-		callback.latch.await(1, TimeUnit.SECONDS);
+		callback.latch.await(5, TimeUnit.SECONDS);
 		String host = callback.local.get("internal");
 		assertNotNull(host);
 		assertEquals("127.0.0.1", host);
@@ -93,7 +93,7 @@ public class SimpleSocketPluginTest extends BriarTestCase {
 		DuplexTransportConnection d = plugin.createConnection(contactId);
 		assertNotNull(d);
 		// Check that the connection was accepted
-		assertTrue(latch.await(1, TimeUnit.SECONDS));
+		assertTrue(latch.await(5, TimeUnit.SECONDS));
 		assertFalse(error.get());
 		// Clean up
 		d.dispose(false, true);
diff --git a/test/net/sf/briar/plugins/tor/TorPluginTest.java b/test/net/sf/briar/plugins/tor/TorPluginTest.java
index 28ed8a65b1..4fbce020b5 100644
--- a/test/net/sf/briar/plugins/tor/TorPluginTest.java
+++ b/test/net/sf/briar/plugins/tor/TorPluginTest.java
@@ -30,7 +30,7 @@ public class TorPluginTest extends BriarTestCase {
 		TorPlugin serverPlugin = new TorPlugin(e, serverCallback, 0L);
 		serverPlugin.start();
 		// The plugin should create a hidden service... eventually
-		serverCallback.latch.await(300, TimeUnit.SECONDS);
+		serverCallback.latch.await(10, TimeUnit.MINUTES);
 		String onion = serverCallback.local.get("onion");
 		assertNotNull(onion);
 		assertTrue(onion.endsWith(".onion"));
@@ -69,7 +69,7 @@ public class TorPluginTest extends BriarTestCase {
 		TorPlugin plugin = new TorPlugin(e, callback, 0L);
 		plugin.start();
 		// The plugin should create a hidden service... eventually
-		callback.latch.await(300, TimeUnit.SECONDS);
+		callback.latch.await(10, TimeUnit.MINUTES);
 		String onion = callback.local.get("onion");
 		assertNotNull(onion);
 		assertTrue(onion.endsWith(".onion"));
@@ -83,7 +83,7 @@ public class TorPluginTest extends BriarTestCase {
 		plugin = new TorPlugin(e, callback, 0L);
 		plugin.start();
 		// The plugin should create a hidden service... eventually
-		callback.latch.await(300, TimeUnit.SECONDS);
+		callback.latch.await(10, TimeUnit.MINUTES);
 		// The onion URL should be the same
 		assertEquals(onion, callback.local.get("onion"));
 		// The private key should be the same
-- 
GitLab