           (.join))
         (.removeShutdownHook ^Runtime (Runtime/getRuntime) (last @hooks))
         (finally
+          (reset! flag false)
           (swap! hooks pop))))
     (testing "inducer invocation"
       (try



(deftest test-add-shutdown-hook
  (let [hooks (atom [])
        context {:bract.core/shutdown-hooks hooks
                 :bract.core/config {"bract.core.drain.timeout" [1 :seconds]}}]
    (testing "default invocation"
      (try

          (.join))
        (.removeShutdownHook ^Runtime (Runtime/getRuntime) (last @hooks))
        (finally
          (reset! flag false)
          (swap! hooks pop))))))


