Current section: Test Database 5 exercises

Managing Test Databases for Parallel Testing

Loading exercise


00:00 So, you know how this thing is totally borked and breaking? Actually, if you run an individual test by itself, like if we were to say the auth test, for example, then it runs just fine. The problem is when you're running multiple tests that need to talk to the same database. And the reason that's happening is because we're creating the database that is being used by all these,

00:19 and then one of these tests says, okay, I'm all done, let's delete all the users. And this test is like, wait a second, I needed some of those users. And so what we really need is completely isolated databases for each of our tests, because VTest is running our tests in parallel, all in separate threads, and threads, it's JavaScript, separate processes.

00:37 And so that's why we're having this problem. So we need to have an individual database for each one of our test runs. And VTest actually makes this pretty easy for us to do. So I think you're going to be successful at this one. Have a good time. We'll see you when you're done.