From 150f04e1cceafb5cb577f170afdd3b7e636345f8 Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Tue, 9 Dec 2014 17:55:41 +0100 Subject: 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. --- .../src/test/java/org/sonar/process/ProcessEntryPointTest.java | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'server/sonar-process/src/test/java') 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); } -- cgit v1.2.3