Hacker News new | ask | show | jobs
by lefra 103 days ago
To avoid that, the code should have ways to override default ports or paths for testing. Then, when testing, ask the OS for a free port or temporary file, and tell the tested code to use that instead of its default. This also allows running tests concurrently.

In what case would talking to an external DB be a problem? Databases support parallel queries.

1 comments

On your last point, imagine worktree A talks to a database assuming some specific schema. If worktree B changes the schema (let’s day, we remove a column from a table), then worktree A can run into some errors.
all schema changes should always be addition only
Maybe ideally, sure. In practice, in an org with multiple engineering teams: good luck enforcing that rule!
no database user has drop rights - very easily enforced