How to wait until Spark service is stopped?
问题 For my Spark API I'm building integration tests. Sometimes I want to stop and start the Spark instance. When I do that I sometimes run into the problem that I'm creating a new Spark instance, while the old one is still shutting down on a separate thread. It would be helpful to know when the Spark instance actually shut down. First I start my Spark instance like this: Spark.init(); Spark.awaitInitialization(); Then I stop it like this: Spark.stop(); Now after I call stop() , the Spark Service