Skip to content

Commit

Permalink
Increase timeout during indexing-job tests (#899)
Browse files Browse the repository at this point in the history
  • Loading branch information
dwwoelfel authored Feb 18, 2025
1 parent 4e8ab87 commit bd66419
Showing 1 changed file with 17 additions and 12 deletions.
29 changes: 17 additions & 12 deletions server/test/instant/db/indexing_jobs_test.clj
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
(ns instant.db.indexing-jobs-test
(:require [honey.sql :as hsql]
[instant.config :as config]
[instant.data.resolvers :as resolvers]
[instant.db.indexing-jobs :as jobs]
[instant.db.model.attr :as attr-model]
Expand All @@ -14,6 +15,10 @@
[instant.util.test :refer [wait-for]]
[clojure.test :refer [deftest testing is]]))

(def wait-timeout (if (= :test (config/get-env))
5000
1000))

(defmacro check-estimate [job]
`(let [finished-job# (jobs/get-by-id (:id ~job))]
(is (pos? (:work_estimate finished-job#)))
Expand Down Expand Up @@ -49,7 +54,7 @@
[title-job
order-job
created-at-job]))
1000)
wait-timeout)
title-triples (triple-model/fetch (aurora/conn-pool :read)
(:id app)
[[:= :attr-id (resolvers/->uuid r :books/title)]])
Expand Down Expand Up @@ -108,7 +113,7 @@
(every? (fn [{:keys [id]}]
(= "errored" (:job_status (jobs/get-by-id id))))
[handle-job]))
1000)
wait-timeout)
handle-triples (triple-model/fetch (aurora/conn-pool :read)
(:id app)
[[:= :attr-id (resolvers/->uuid r :users/handle)]])]
Expand Down Expand Up @@ -141,7 +146,7 @@
(every? (fn [{:keys [id]}]
(= "completed" (:job_status (jobs/get-by-id id))))
[title-job]))
1000)
wait-timeout)
title-triples (triple-model/fetch (aurora/conn-pool :read)
(:id app)
[[:= :attr-id (resolvers/->uuid r :books/title)]])]
Expand All @@ -163,7 +168,7 @@
(every? (fn [{:keys [id]}]
(= "completed" (:job_status (jobs/get-by-id id))))
[remove-type-job]))
1000)
wait-timeout)
title-triples (triple-model/fetch (aurora/conn-pool :read)
(:id app)
[[:= :attr-id (resolvers/->uuid r :books/title)]])]
Expand Down Expand Up @@ -194,7 +199,7 @@
(every? (fn [{:keys [id]}]
(= "completed" (:job_status (jobs/get-by-id id))))
[title-job]))
1000)
wait-timeout)
title-triples (triple-model/fetch (aurora/conn-pool :read)
(:id app)
[[:= :attr-id (resolvers/->uuid r :books/title)]])]
Expand Down Expand Up @@ -222,7 +227,7 @@
(every? (fn [{:keys [id]}]
(= "completed" (:job_status (jobs/get-by-id id))))
[remove-index-job]))
1000)
wait-timeout)
title-triples (triple-model/fetch (aurora/conn-pool :read)
(:id app)
[[:= :attr-id (resolvers/->uuid r :books/title)]])]
Expand Down Expand Up @@ -272,7 +277,7 @@
(every? (fn [{:keys [id]}]
(= "completed" (:job_status (jobs/get-by-id id))))
[title-job]))
1000)
wait-timeout)
title-triples-after (triple-model/fetch (aurora/conn-pool :read)
(:id app)
[[:= :attr-id (resolvers/->uuid r :books/title)]])]
Expand Down Expand Up @@ -331,7 +336,7 @@
(every? (fn [{:keys [id]}]
(= "completed" (:job_status (jobs/get-by-id id))))
[job]))
1000)
wait-timeout)
triples-after (triple-model/fetch (aurora/conn-pool :read)
(:id app)
[[:= :attr-id (resolvers/->uuid r :users/bookshelves)]])]
Expand Down Expand Up @@ -389,7 +394,7 @@
(every? (fn [{:keys [id]}]
(= "completed" (:job_status (jobs/get-by-id id))))
[job]))
5000)
wait-timeout)
triples (triple-model/fetch (aurora/conn-pool :read)
(:id app)
[[:= :attr-id attr-id]])]
Expand All @@ -414,7 +419,7 @@
(every? (fn [{:keys [id]}]
(= "completed" (:job_status (jobs/get-by-id id))))
[remove-unique-job]))
1000)
wait-timeout)
triples (triple-model/fetch (aurora/conn-pool :read)
(:id app)
[[:= :attr-id attr-id]])]
Expand Down Expand Up @@ -465,7 +470,7 @@
(every? (fn [{:keys [id]}]
(= "errored" (:job_status (jobs/get-by-id id))))
[job]))
1000)
wait-timeout)
triples (triple-model/fetch (aurora/conn-pool :read)
(:id app)
[[:= :attr-id attr-id]])
Expand Down Expand Up @@ -535,7 +540,7 @@
(not (contains? #{"processing" "waiting"} (:job_status (jobs/get-by-id id)))))
[unique-job
index-job]))
1000)
wait-timeout)
triples (triple-model/fetch (aurora/conn-pool :read)
(:id app)
[[:= :attr-id attr-id]])
Expand Down

0 comments on commit bd66419

Please sign in to comment.