           (is (= 200 status) (str "Did not get a 200 response. " body))
           (when (and (= 200 status) (can-query-for-grace-period? waiter-url))
             (log/info "Verifying app grace period for" token)
-            (is (= (time/in-seconds grace-period) (service-id->grace-period waiter-url service-id))))
+            (is (= (t/in-seconds grace-period) (service-id->grace-period waiter-url service-id))))
           (delete-service waiter-url service-id))
         (finally
           (delete-token-and-assert waiter-url token))))))


(defmacro assert-failed-request [service-name response-body start-time-ms timeout-period-sec faulty-app?]
  `(let [end-time-ms# (System/currentTimeMillis)
         elapsed-time-secs# (time/in-seconds (time/millis (- end-time-ms# ~start-time-ms)))]
     (is (>= elapsed-time-secs# ~timeout-period-sec))
     (is (str/includes? ~response-body (str "After " ~timeout-period-sec " seconds, no instance available to handle request.")))
     (when ~faulty-app?

;; limitations under the License.
;;
(ns waiter.request-timeout-test
  (:require [clj-time.core :as t]
            [clojure.string :as str]
            [clojure.test :refer :all]
            [clojure.tools.logging :as log]
