Prevent NPE while running tests
Prevent thread leaks while running tests : cleanup all threads when SparkContext.stop is invoked. Causes tests to fail