Samarth Jain created PHOENIX-4127:
-------------------------------------

             Summary: Shutdownhook that halts JVM is causing test runs to fail
                 Key: PHOENIX-4127
                 URL: https://issues.apache.org/jira/browse/PHOENIX-4127
             Project: Phoenix
          Issue Type: Bug
            Reporter: Samarth Jain


When all the unit tests actually pass, surefire still reports that there was an 
error in the fork. This is because it doesn't like the fact that a forked JVM 
called system.exit() or system.halt(). We have a shutdown hook in BaseTest 
which does that. Such failed runs happen more frequently on the  4.x-HBase-0.98 
branch. And sometimes on the master and 1.1 branch. 

I know the code was added because we were seeing test runs hang. Since we 
changed a lot of tests since then, I would like to remove that hook and see if 
it helps.

{code}
private static String checkClusterInitialized(ReadOnlyProps serverProps) throws 
Exception {
        if (!clusterInitialized) {
            url = setUpTestCluster(config, serverProps);
            clusterInitialized = true;
            Runtime.getRuntime().addShutdownHook(new Thread() {
                @Override
                public void run() {
                    logger.info("SHUTDOWN: halting JVM now");
                    Runtime.getRuntime().halt(0);
                }
            });
        }
        return url;
    }
{code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to