Skip to content

Commit 6ae91b0

Browse files
committed
More un-flakying of tests
1 parent ab4e005 commit 6ae91b0

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

test/lambdaisland/funnel_test.clj

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -132,18 +132,20 @@
132132
@(:history c3)))))
133133

134134
(testing "map queries"
135-
(with-open [s (test-server)
136-
c1 (test-client)
137-
c2 (test-client)
138-
c3 (test-client)]
139-
(c1 {:funnel/whoami {:id 123 :type :x :subtype :a}})
140-
(c2 {:funnel/whoami {:id 456 :type :x :subtype :b}})
141-
(c3 {:funnel/whoami {:id 789 :type :y :subtype :b}})
142-
143-
(c1 {:funnel/query {:type :x :subtype :b}})
144-
(will (= [{:funnel/clients
145-
[{:id 456 :type :x :subtype :b}]}]
146-
@(:history c1))))))
135+
(let [state (atom {})]
136+
(with-open [s (test-server state)
137+
c1 (test-client)
138+
c2 (test-client)
139+
c3 (test-client)]
140+
(c1 {:funnel/whoami {:id 123 :type :x :subtype :a}})
141+
(c2 {:funnel/whoami {:id 456 :type :x :subtype :b}})
142+
(c3 {:funnel/whoami {:id 789 :type :y :subtype :b}})
143+
(will (= 3 (count @state)))
144+
145+
(c1 {:funnel/query {:type :x :subtype :b}})
146+
(will (= [{:funnel/clients
147+
[{:id 456 :type :x :subtype :b}]}]
148+
@(:history c1)))))))
147149

148150

149151

0 commit comments

Comments
 (0)