Files
swift/test/unit/account/test_utils.py
Matthew Oliver a548da916f Remove :memory: from DatabaseBrokers and unittests
The SQLite in-memory databases have been great for testing but
as the swift DatabaseBroker's have become more complex, the limitations
of in memory databases are being reached. Mostly due
to the introduction of container sharding where a broker sometimes needs
to make multiple connections to the same database as the same time.

Rather then rework the real broker logic to better support in-memory
testing, it's actually easier to just remove the in-memory broker tests
and use a "real" broker in a tempdir. This allows us to better test how
brokers behave in real life, pending files and all.

This patch replaces all the :memory: brokers in the tests with real ones
placed in a tempdir. To achieve this, we new base unittest class `TestDBBase`
has been added that creates, cleans up and provides some helper methods
to manage the db path and location.

Further, all references to :memory: in the Database brokers have been
removed.

Change-Id: I5983132f776b84db634fef39c833d5cfdce11980
2022-07-12 12:30:43 +10:00

11 KiB