Improve tests on slow machines and on windows
diff --git a/sshd-core/src/test/java/org/apache/sshd/KeepAliveTest.java b/sshd-core/src/test/java/org/apache/sshd/KeepAliveTest.java
index a652d42..3a5c496 100644
--- a/sshd-core/src/test/java/org/apache/sshd/KeepAliveTest.java
+++ b/sshd-core/src/test/java/org/apache/sshd/KeepAliveTest.java
@@ -45,9 +45,9 @@
private SshServer sshd;
private int port;
- private int heartbeat = 1000;
- private int timeout = 2000;
- private int wait = 4000;
+ private int heartbeat = 2000;
+ private int timeout = 4000;
+ private int wait = 8000;
@Before
public void setUp() throws Exception {
diff --git a/sshd-core/src/test/java/org/apache/sshd/ServerTest.java b/sshd-core/src/test/java/org/apache/sshd/ServerTest.java
index 4f4e496..e79fe23 100644
--- a/sshd-core/src/test/java/org/apache/sshd/ServerTest.java
+++ b/sshd-core/src/test/java/org/apache/sshd/ServerTest.java
@@ -132,12 +132,12 @@
@Test
public void testAuthenticationTimeout() throws Exception {
- sshd.getProperties().put(SshServer.AUTH_TIMEOUT, "1000");
+ sshd.getProperties().put(SshServer.AUTH_TIMEOUT, "5000");
client = SshClient.setUpDefaultClient();
client.start();
ClientSession s = client.connect("localhost", port).await().getSession();
- int res = s.waitFor(ClientSession.CLOSED, 5000);
+ int res = s.waitFor(ClientSession.CLOSED, 10000);
assertEquals("Session should be closed", ClientSession.CLOSED | ClientSession.WAIT_AUTH, res);
}
diff --git a/sshd-core/src/test/java/org/apache/sshd/SftpTest.java b/sshd-core/src/test/java/org/apache/sshd/SftpTest.java
index 256fa85..7d3a95e 100644
--- a/sshd-core/src/test/java/org/apache/sshd/SftpTest.java
+++ b/sshd-core/src/test/java/org/apache/sshd/SftpTest.java
@@ -237,6 +237,11 @@
@Test
public void testCreateSymbolicLink() throws Exception {
+ // Do not execute on windows as the file system does not support symlinks
+ if (System.getProperty("os.name").toLowerCase().contains("win")) {
+ return;
+ }
+
File root = new File("target/sftp");
String unixPath = "target/sftp/out.txt";
String linkUnixPath = "target/sftp/link.txt";
diff --git a/sshd-core/src/test/java/org/apache/sshd/SinglePublicKeyAuthTest.java b/sshd-core/src/test/java/org/apache/sshd/SinglePublicKeyAuthTest.java
index 29efe15..43fb8bf 100644
--- a/sshd-core/src/test/java/org/apache/sshd/SinglePublicKeyAuthTest.java
+++ b/sshd-core/src/test/java/org/apache/sshd/SinglePublicKeyAuthTest.java
@@ -107,6 +107,7 @@
assertEquals(1, count.get(KeyUtils.getFingerPrint(pairRsaBad.getPublic())).get());
assertEquals(1, count.get(KeyUtils.getFingerPrint(pairRsa.getPublic())).get());
client.close(false).await();
+ Thread.sleep(100);
assertTrue(auth.getCache().isEmpty());
}