This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-02-17
Channels
- # admin-announcements (3)
- # announcements (1)
- # aws (3)
- # beginners (41)
- # boot (109)
- # braid-chat (2)
- # braveandtrue (5)
- # cider (11)
- # cljs-dev (38)
- # cljsjs (15)
- # cljsrn (5)
- # clojure (87)
- # clojure-berlin (16)
- # clojure-ireland (1)
- # clojure-japan (10)
- # clojure-madison (3)
- # clojure-nl (3)
- # clojure-poland (6)
- # clojure-russia (115)
- # clojure-sg (1)
- # clojurebridge (35)
- # clojured (8)
- # clojurescript (36)
- # core-async (24)
- # cursive (18)
- # datavis (1)
- # datomic (27)
- # dirac (22)
- # editors (1)
- # emacs (3)
- # events (19)
- # hoplon (149)
- # ldnclj (7)
- # lein-figwheel (1)
- # luminus (1)
- # off-topic (70)
- # om (196)
- # onyx (63)
- # parinfer (155)
- # proton (36)
- # re-frame (69)
- # reagent (2)
- # ring (2)
- # ring-swagger (1)
- # slack-help (4)
- # spacemacs (9)
- # testing (11)
hi folks! what suggestions do you have for avoiding race conditions in tests? e.g. something is being saved into the database and the test is failing because the read returns nothing. it’s a case of “save and forget”, write doesn’t return anything. I don’t want to add Thread/sleep
everywhere..
@raymcdermott: for clojurescript there is https://github.com/clojure/clojurescript/wiki/Testing#async-testing
@annapawlicka: I'm not sure I follow, the write is fire and forget, the test continues, tries to read, but the write is not yet done?
yup, pretty much. usually it’s done by that time as writes in cassandra are very fast, but sometimes there’s an odd case when they’re not
my only ideas are to a) make a synchronous version of write for testing purposes (the cassandra's api might have it)
i’ll try the first two. thanks for tips!