Open geekingfrog opened 3 months ago
I tested and it worked with this test: https://github.com/beyond-all-reason/teiserver/blob/f6421ac748e1a215d61959cc9fafea6144717288/test/teiserver/common/clear_db_each_test.exs
Would be better if some sort of test was included in this PR.
I've added a test in f543bccb7bd2e738029595369d421cf452d988dd. Not sure of its value but it's something at least.
Yeah I was thinking of the add user test that caused me to find the bug in the first place.
Alright, I amended the commit and ended up using your test file. Not the biggest fan, but it's a start and definitely better than nothing.
I'm going to hold off merging that, there's something fishy going on with some tests :( async + global caches => weird shit happening
This must be done for data cases as well as server cases. Because most of the querying logic rely under the hood on the caches, when someone creates a user, it won't be persisted to the DB after the test, but the cache will not be rolled back.