From: Artur Signell Date: Thu, 27 Feb 2014 09:33:16 +0000 (+0200) Subject: Re-try opening ssh tunnel if it fails the first time(s) X-Git-Tag: 7.1.12~6 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=6249518;p=vaadin-framework.git Re-try opening ssh tunnel if it fails the first time(s) Change-Id: I653db3a818435c023f0bbd8015d2bd1a35ed4e34 --- diff --git a/uitest/src/com/vaadin/tests/tb3/MultiBrowserTestWithProxy.java b/uitest/src/com/vaadin/tests/tb3/MultiBrowserTestWithProxy.java index 0bb76889a0..1a1e507a4a 100755 --- a/uitest/src/com/vaadin/tests/tb3/MultiBrowserTestWithProxy.java +++ b/uitest/src/com/vaadin/tests/tb3/MultiBrowserTestWithProxy.java @@ -72,8 +72,23 @@ public abstract class MultiBrowserTestWithProxy extends MultiBrowserTest { if (proxySession != null) { return; } - - createProxy(getProxyPort()); + for (int i = 0; i < 10; i++) { + // Potential workaround for problem with establishing many ssh + // connections at the same time + try { + createProxy(getProxyPort()); + break; + } catch (JSchException e) { + try { + sleep(500); + } catch (InterruptedException e1) { + } + if (i == 9) { + throw new RuntimeException( + "All 10 attempts to connect a proxy failed", e); + } + } + } } private void createProxy(int proxyPort) throws JSchException {