testing

Testing tools, testing philosophy & methodology...
raymcdermott 2016-02-17T19:39:10.000015Z

hi guys, any good resources on testing with core.async?

annapawlicka 2016-02-17T21:25:36.000017Z

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..

2016-02-17T22:25:52.000018Z

@raymcdermott: for clojurescript there is https://github.com/clojure/clojurescript/wiki/Testing#async-testing

2016-02-17T22:26:40.000020Z

@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?

annapawlicka 2016-02-17T22:28:07.000021Z

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

2016-02-17T22:29:27.000022Z

hhmmm

2016-02-17T22:29:56.000023Z

my only ideas are to a) make a synchronous version of write for testing purposes (the cassandra's api might have it)

2016-02-17T22:30:27.000025Z

b) retry the read if nil (once should do it, right?)

2016-02-17T22:30:35.000026Z

c) use Thread/sleep

2016-02-17T22:30:44.000027Z

I'm sorry this is not too helpful

annapawlicka 2016-02-17T22:30:55.000028Z

i’ll try the first two. thanks for tips!