Added test to ensure proper shutdown and parallel execution