I played around with this for quite a while. It appears nrepl-load-current-buffer is async which I didn't notice first time around which caused a bunch of issues randomly.
I can now load any file, in any order, and run the tests at any point and it works for me. Can you have another look at these changes?
Attempting to fix test mode with nrepl. Use sync functions for loading
current before to avoid race.