Remove unnecessary shutdownhook and add test dir