Skip to content

Commit

Permalink
Patch flaky tests
Browse files Browse the repository at this point in the history
  • Loading branch information
vharmain committed Nov 24, 2024
1 parent e747ef5 commit 7d47165
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion webapp/test/clj/lipas/test_utils.clj
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
[lipas.backend.search :as search]
[lipas.backend.system :as sy]
[lipas.schema.core]
[lipas.utils :as utils]
[migratus.core :as migratus]
[ring.mock.request :as mock])
(:import [java.io ByteArrayOutputStream]
Expand All @@ -20,7 +21,10 @@
(defn gen-sports-site
[]
(try
(gen/generate (s/gen :lipas/sports-site))
;; FIXME :ptv generators produce difficult values
(-> (s/gen :lipas/sports-site)
gen/generate
(dissoc :ptv))
(catch Throwable _t (gen-sports-site))))

(def <-json #(j/parse-string (slurp %) true))
Expand Down Expand Up @@ -169,3 +173,7 @@
(-> (gen/generate (s/gen :lipas.loi/document))
(assoc :status "active")
(assoc :id (str (java.util.UUID/randomUUID)))))

(comment
(every? #(s/valid? :lipas/sports-site %) (repeatedly 100 gen-sports-site))
)

0 comments on commit 7d47165

Please sign in to comment.