re: Practical Rust Web Development - Testing VIEW POST

TOP OF THREAD FULL DISCUSSION
re: Hi again, On this one you solved about 5 questions I had! :) . Did you have undesirable interactions between tests?, in tests/product_test.rs on c...
 

Well, I just had the regular problems about the borrow checker, that's why I figured it out I would need RefCell. However, I think the test run synchronously, did you use the to method or to_async route method?

 

nope, just to(), but it was actually on unittest on Diesel only tasks, it's not about data races inside Rust but data races with the database is that makes sense, the unittests ran in parallel (that can be changed but would be slower) and as all tests used the same database, when 1 test cleared a table sometimes it did it just after another tests just created an entry for himself, other times 1 test tryied to create a user but other test had just created another one with the same name, etc. So I don't think is something relevant on runtime just on tests

Oh, ok, I understand, did you try to handle the parallelism to a continuous integration server? CircleCI is great with that.

no really, I'm gonna check it out, even tho with the random username got solved but I like the idea of running my tests outside to get my weakling PC a rest

code of conduct - report abuse