diff options
author | Simon Brandhof <simon.brandhof@sonarsource.com> | 2014-12-09 17:55:41 +0100 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@sonarsource.com> | 2014-12-09 17:55:41 +0100 |
commit | 150f04e1cceafb5cb577f170afdd3b7e636345f8 (patch) | |
tree | 3da80e83ef601a80cba0c34599f9379a327aa164 /server/sonar-process/src/test/java | |
parent | 5a15fe757e098781480bcebd0cfc5391af271124 (diff) | |
download | sonarqube-150f04e1cceafb5cb577f170afdd3b7e636345f8.tar.gz sonarqube-150f04e1cceafb5cb577f170afdd3b7e636345f8.zip |
Fix computation of JaCoCo coverage of module sonar-process
The shutdown hook of ProcessEntryPoint was manually started by ProcessEntryPointTest but not unregistered from system hooks. It failed when JUnit JVM exited (without crashing build). The side-effect is that JaCoCo fail to export results.
Diffstat (limited to 'server/sonar-process/src/test/java')
-rw-r--r-- | server/sonar-process/src/test/java/org/sonar/process/ProcessEntryPointTest.java | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/server/sonar-process/src/test/java/org/sonar/process/ProcessEntryPointTest.java b/server/sonar-process/src/test/java/org/sonar/process/ProcessEntryPointTest.java index 987ee025a58..9560c3c7f38 100644 --- a/server/sonar-process/src/test/java/org/sonar/process/ProcessEntryPointTest.java +++ b/server/sonar-process/src/test/java/org/sonar/process/ProcessEntryPointTest.java @@ -133,6 +133,10 @@ public class ProcessEntryPointTest { // emulate signal to shutdown process entryPoint.getShutdownHook().start(); + + // hack to prevent JUnit JVM to fail when executing the shutdown hook a second time + Runtime.getRuntime().removeShutdownHook(entryPoint.getShutdownHook()); + while (process.getState() != State.STOPPED) { Thread.sleep(10L); } |