 
 (defn spark [version]
   (fn []
-    (start-spark version)
-    #(stop-cluster version)))
+    (start-cluster version)
+    #(timing "Cluster shutdown"
+       (stop-cluster version))))

            [clojure.test :refer :all]
            [clojure.java.shell :refer [sh]]
            [clojure.string :as s]))

(defn sh! [& args]
  (let [{:keys [exit out err] :as ret} (apply sh args)]

  (when-not (System/getenv "CIRCLECI")
    (sh! "docker" "rm" instance)))

(defn start-cluster [version]
  (let [pwd (.getAbsolutePath (java.io.File. ""))]
    (timing "Master startup"
      (start-master pwd version))
    (Thread/sleep 2000)
    (timing "Worker startup"
      (start-worker pwd version))
    (Thread/sleep 2000)))

(defn stop-cluster [version]
