LOC-24 Close and re-open DB connection, and implement E2E test
author B Tasker
()
committer B Tasker
()
commit 7d46d53ee2e22d1b1e8d9cdf0a3c8a48f17a2ceb
tree 9fe5b8b76944a24f18b392c7b88f1dd0004e76c1
parent 6a45137ebc04e3f52793dfa812e5077797263b81
LOC-24 Close and re-open DB connection, and implement E2E test

These are part of one commit because implementing the test revealed a potential race.

API requests can fail because of lock contention with the test script, leading to a failed test (and often then an exception when we try to query the database).

Now, we open a new connection to the database just before querying and then close straight after to ensure locks do not become an issue.

This wouldn't be an issue with a production deployment as the DB is in memory and only ever being accessed by the one thread.
tests/run_tests.py