top | item 39561963

(no title)

iFreilicht | 2 years ago

One specific case that I encountered recently was implementing "integration" tests, where I needed to test some behavior that relies on the global state of a database. All other tests before were easily parallelized, and this meant our whole service could be fully tested within 10-30 seconds (dev machine vs. pipeline).

However, the new tests could not be run in parallel with the existing ones, as the changes in global state in the database caused flaky failures. I know there will be other tests like them in the future, so I want a robust way of writing these kinds of "global" tests without too much manual labor.

Spinning up a new postgres instance for each of these specific tests would be one solution.

I would like to instead go for running the tests inside of transactions, but that comes with its own sorts of issues.

discuss

order

No comments yet.