                                      (reset! shutdown-called? true)
                                      context))
             app              (boot-service-and-jetty-with-default-config
-                               test-service)]
+                               test-service)
+            jetty-server     (get-jetty-server-from-app-context app)]
         (is (thrown-with-msg?
               Throwable
               #"oops"
               (tk-core/run-app app))
             "tk run-app did not die with expected exception.")
+        (is (nil? jetty-server)
+            (str "Jetty server was unexpectedly attached to the service "
+                 "context."))
         (is (true? @shutdown-called?)
             "Service shutdown was not called.")))))
           "Service shutdown was not called.")
       (is (.isStopped jetty-server)
           "Jetty server was not stopped at shutdown."))))
  (testing (str "jetty and any dependent services are shutdown after a"
                "service throws an error from its init function")
    (with-test-logging
      (let [shutdown-called? (atom false)
            test-service     (tk-services/service

                                    context))
           app              (boot-service-and-jetty-with-default-config
                              test-service)
           jetty-server     (get-jetty-server-from-app-context app)]
       (is (.isStarted jetty-server)
           "Jetty server was never started")
       (is (thrown-with-msg?
