[SSHD-822] Exclude SftpVersionsTest from Netty unit tests due to frequent failures
Project: http://git-wip-us.apache.org/repos/asf/mina-sshd/repo Commit: http://git-wip-us.apache.org/repos/asf/mina-sshd/commit/ea2ab6e1 Tree: http://git-wip-us.apache.org/repos/asf/mina-sshd/tree/ea2ab6e1 Diff: http://git-wip-us.apache.org/repos/asf/mina-sshd/diff/ea2ab6e1 Branch: refs/heads/master Commit: ea2ab6e14e46bda0a4dc38e01e5679e9937be706 Parents: f99573b Author: Lyor Goldstein <[email protected]> Authored: Wed Aug 29 22:26:25 2018 +0300 Committer: Lyor Goldstein <[email protected]> Committed: Wed Aug 29 22:26:25 2018 +0300 ---------------------------------------------------------------------- sshd-sftp/pom.xml | 1 + .../client/subsystem/sftp/SftpVersionsTest.java | 45 ++++++++++++++------ 2 files changed, 32 insertions(+), 14 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/ea2ab6e1/sshd-sftp/pom.xml ---------------------------------------------------------------------- diff --git a/sshd-sftp/pom.xml b/sshd-sftp/pom.xml index f51d674..e26eb32 100644 --- a/sshd-sftp/pom.xml +++ b/sshd-sftp/pom.xml @@ -188,6 +188,7 @@ <excludes> <!-- TODO need some more research as to why this fails frequently on Netty --> <exclude>**/AbstractCheckFileExtensionTest.java</exclude> + <exclude>**/SftpVersionsTest.java</exclude> </excludes> </configuration> </execution> http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/ea2ab6e1/sshd-sftp/src/test/java/org/apache/sshd/client/subsystem/sftp/SftpVersionsTest.java ---------------------------------------------------------------------- diff --git a/sshd-sftp/src/test/java/org/apache/sshd/client/subsystem/sftp/SftpVersionsTest.java b/sshd-sftp/src/test/java/org/apache/sshd/client/subsystem/sftp/SftpVersionsTest.java index 09bb1a9..0e82f6e 100644 --- a/sshd-sftp/src/test/java/org/apache/sshd/client/subsystem/sftp/SftpVersionsTest.java +++ b/sshd-sftp/src/test/java/org/apache/sshd/client/subsystem/sftp/SftpVersionsTest.java @@ -85,6 +85,9 @@ public class SftpVersionsTest extends AbstractSftpClientTestSupport { .boxed() .collect(Collectors.toList())); + private static final long CONNECT_TIMEOUT = 7L; + private static final long AUTH_TIMEOUT = 5L; + private final int testVersion; public SftpVersionsTest(int version) throws IOException { @@ -115,9 +118,11 @@ public class SftpVersionsTest extends AbstractSftpClientTestSupport { Path parentPath = targetPath.getParent(); String remotePath = Utils.resolveRelativeRemotePath(parentPath, lclFile); - try (ClientSession session = client.connect(getCurrentTestName(), TEST_LOCALHOST, port).verify(7L, TimeUnit.SECONDS).getSession()) { + try (ClientSession session = client.connect(getCurrentTestName(), TEST_LOCALHOST, port) + .verify(CONNECT_TIMEOUT, TimeUnit.SECONDS) + .getSession()) { session.addPasswordIdentity(getCurrentTestName()); - session.auth().verify(5L, TimeUnit.SECONDS); + session.auth().verify(AUTH_TIMEOUT, TimeUnit.SECONDS); try (SftpClient sftp = createSftpClient(session, getTestedVersion())) { try (OutputStream out = sftp.write(remotePath, OpenMode.Create, OpenMode.Write)) { out.write(getCurrentTestName().getBytes(StandardCharsets.UTF_8)); @@ -130,9 +135,11 @@ public class SftpVersionsTest extends AbstractSftpClientTestSupport { @Test public void testSftpVersionSelector() throws Exception { - try (ClientSession session = client.connect(getCurrentTestName(), TEST_LOCALHOST, port).verify(7L, TimeUnit.SECONDS).getSession()) { + try (ClientSession session = client.connect(getCurrentTestName(), TEST_LOCALHOST, port) + .verify(CONNECT_TIMEOUT, TimeUnit.SECONDS) + .getSession()) { session.addPasswordIdentity(getCurrentTestName()); - session.auth().verify(5L, TimeUnit.SECONDS); + session.auth().verify(AUTH_TIMEOUT, TimeUnit.SECONDS); try (SftpClient sftp = createSftpClient(session, getTestedVersion())) { assertEquals("Mismatched negotiated version", getTestedVersion(), sftp.getVersion()); @@ -148,9 +155,11 @@ public class SftpVersionsTest extends AbstractSftpClientTestSupport { Files.write(lclFile, getClass().getName().getBytes(StandardCharsets.UTF_8)); Path parentPath = targetPath.getParent(); String remotePath = Utils.resolveRelativeRemotePath(parentPath, lclFile); - try (ClientSession session = client.connect(getCurrentTestName(), TEST_LOCALHOST, port).verify(7L, TimeUnit.SECONDS).getSession()) { + try (ClientSession session = client.connect(getCurrentTestName(), TEST_LOCALHOST, port) + .verify(CONNECT_TIMEOUT, TimeUnit.SECONDS) + .getSession()) { session.addPasswordIdentity(getCurrentTestName()); - session.auth().verify(5L, TimeUnit.SECONDS); + session.auth().verify(AUTH_TIMEOUT, TimeUnit.SECONDS); try (SftpClient sftp = createSftpClient(session, getTestedVersion())) { Attributes attrs = sftp.lstat(remotePath); @@ -186,9 +195,11 @@ public class SftpVersionsTest extends AbstractSftpClientTestSupport { Path parentPath = targetPath.getParent(); String remotePath = Utils.resolveRelativeRemotePath(parentPath, lclSftp); - try (ClientSession session = client.connect(getCurrentTestName(), TEST_LOCALHOST, port).verify(7L, TimeUnit.SECONDS).getSession()) { + try (ClientSession session = client.connect(getCurrentTestName(), TEST_LOCALHOST, port) + .verify(CONNECT_TIMEOUT, TimeUnit.SECONDS) + .getSession()) { session.addPasswordIdentity(getCurrentTestName()); - session.auth().verify(5L, TimeUnit.SECONDS); + session.auth().verify(AUTH_TIMEOUT, TimeUnit.SECONDS); try (SftpClient sftp = createSftpClient(session, getTestedVersion())) { for (DirEntry entry : sftp.readDir(remotePath)) { @@ -299,9 +310,11 @@ public class SftpVersionsTest extends AbstractSftpClientTestSupport { List<NamedFactory<Command>> factories = sshd.getSubsystemFactories(); sshd.setSubsystemFactories(Collections.singletonList(factory)); - try (ClientSession session = client.connect(getCurrentTestName(), TEST_LOCALHOST, port).verify(7L, TimeUnit.SECONDS).getSession()) { + try (ClientSession session = client.connect(getCurrentTestName(), TEST_LOCALHOST, port) + .verify(CONNECT_TIMEOUT, TimeUnit.SECONDS) + .getSession()) { session.addPasswordIdentity(getCurrentTestName()); - session.auth().verify(5L, TimeUnit.SECONDS); + session.auth().verify(AUTH_TIMEOUT, TimeUnit.SECONDS); try (SftpClient sftp = createSftpClient(session, getTestedVersion())) { for (DirEntry entry : sftp.readDir(remotePath)) { @@ -416,9 +429,11 @@ public class SftpVersionsTest extends AbstractSftpClientTestSupport { List<NamedFactory<Command>> factories = sshd.getSubsystemFactories(); sshd.setSubsystemFactories(Collections.singletonList(factory)); - try (ClientSession session = client.connect(getCurrentTestName(), TEST_LOCALHOST, port).verify(7L, TimeUnit.SECONDS).getSession()) { + try (ClientSession session = client.connect(getCurrentTestName(), TEST_LOCALHOST, port) + .verify(CONNECT_TIMEOUT, TimeUnit.SECONDS) + .getSession()) { session.addPasswordIdentity(getCurrentTestName()); - session.auth().verify(5L, TimeUnit.SECONDS); + session.auth().verify(AUTH_TIMEOUT, TimeUnit.SECONDS); try (SftpClient sftp = createSftpClient(session, getTestedVersion())) { for (DirEntry entry : sftp.readDir(remotePath)) { @@ -445,9 +460,11 @@ public class SftpVersionsTest extends AbstractSftpClientTestSupport { @Test // see SSHD-623 public void testEndOfListIndicator() throws Exception { - try (ClientSession session = client.connect(getCurrentTestName(), TEST_LOCALHOST, port).verify(7L, TimeUnit.SECONDS).getSession()) { + try (ClientSession session = client.connect(getCurrentTestName(), TEST_LOCALHOST, port) + .verify(CONNECT_TIMEOUT, TimeUnit.SECONDS) + .getSession()) { session.addPasswordIdentity(getCurrentTestName()); - session.auth().verify(5L, TimeUnit.SECONDS); + session.auth().verify(AUTH_TIMEOUT, TimeUnit.SECONDS); try (SftpClient sftp = createSftpClient(session, getTestedVersion())) { AtomicReference<Boolean> eolIndicator = new AtomicReference<>();
