Unverified 提交 6a922bab authored 作者: Noel Grandin's avatar Noel Grandin 提交者: GitHub

Merge pull request #839 from katzyn/tests

TestTools should not leave testing thread in interrupted state
...@@ -139,7 +139,7 @@ public class TestTools extends TestBase { ...@@ -139,7 +139,7 @@ public class TestTools extends TestBase {
c.runTool("-web", "-webPort", "9002", "-tool", "-browser", "-tcp", c.runTool("-web", "-webPort", "9002", "-tool", "-browser", "-tcp",
"-tcpPort", "9003", "-pg", "-pgPort", "9004"); "-tcpPort", "9003", "-pg", "-pgPort", "9004");
assertContains(lastUrl, ":9002"); assertContains(lastUrl, ":9002");
c.shutdown(); shutdownConsole(c);
// check if starting the browser works // check if starting the browser works
c.runTool("-web", "-webPort", "9002", "-tool"); c.runTool("-web", "-webPort", "9002", "-tool");
...@@ -169,7 +169,7 @@ public class TestTools extends TestBase { ...@@ -169,7 +169,7 @@ public class TestTools extends TestBase {
// ignore // ignore
} }
c.shutdown(); shutdownConsole(c);
// trying to use the same port for two services should fail, // trying to use the same port for two services should fail,
// but also stop the first service // but also stop the first service
...@@ -184,7 +184,19 @@ public class TestTools extends TestBase { ...@@ -184,7 +184,19 @@ public class TestTools extends TestBase {
} else { } else {
System.clearProperty(SysProperties.H2_BROWSER); System.clearProperty(SysProperties.H2_BROWSER);
} }
c.shutdown(); shutdownConsole(c);
}
}
private static void shutdownConsole(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 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论