提交 59688568 authored 作者: Evgenij Ryazanov's avatar Evgenij Ryazanov

TestTools should not leave testing thread in interrupted status

上级 88ad5a36
......@@ -139,7 +139,7 @@ public class TestTools extends TestBase {
c.runTool("-web", "-webPort", "9002", "-tool", "-browser", "-tcp",
"-tcpPort", "9003", "-pg", "-pgPort", "9004");
assertContains(lastUrl, ":9002");
c.shutdown();
shutdownConlose(c);
// check if starting the browser works
c.runTool("-web", "-webPort", "9002", "-tool");
......@@ -169,7 +169,7 @@ public class TestTools extends TestBase {
// ignore
}
c.shutdown();
shutdownConlose(c);
// trying to use the same port for two services should fail,
// but also stop the first service
......@@ -184,7 +184,19 @@ public class TestTools extends TestBase {
} else {
System.clearProperty(SysProperties.H2_BROWSER);
}
c.shutdown();
shutdownConlose(c);
}
}
private static void shutdownConlose(Console c) {
c.shutdown();
if (Thread.currentThread().isInterrupted()) {
// Clear interrupted state so test can continue its work safely
try {
Thread.sleep(1);
} catch (InterruptedException e) {
// Ignore
}
}
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论