Add graceful shutdown test