hi guys, any good resources on testing with core.async?
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
hhmmm
my only ideas are to a) make a synchronous version of write for testing purposes (the cassandra's api might have it)
b) retry the read if nil (once should do it, right?)
c) use Thread/sleep
I'm sorry this is not too helpful
i’ll try the first two. thanks for tips!