test periodically and shutdown