I accidentally made this mistake while trying to avoid the exact same issue back in commit 73992b2c8. Accessing the database in a test after starting the process running the browser has caused database corruption in our CI multiple times.
73992b2c8