gh-108550: Speed up sqlite3 tests (#108551)

Refactor the CLI so we can easily invoke it and mock command-line
arguments. Adapt the CLI tests so we no longer have to launch a
separate process.

Disable the busy handler for all concurrency tests; we have full
control over the order of the SQLite C API calls, so we can safely
do this.

The sqlite3 test suite now completes ~8 times faster than before.

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
This commit is contained in:
Erlend E. Aasland 2023-08-28 14:17:34 +02:00 committed by GitHub
parent 8db451ceb1
commit 0e8b3fc718
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 73 additions and 100 deletions

View file

@ -1854,7 +1854,7 @@ class SqliteOnConflictTests(unittest.TestCase):
@requires_subprocess()
class MultiprocessTests(unittest.TestCase):
CONNECTION_TIMEOUT = SHORT_TIMEOUT / 1000. # Defaults to 30 ms
CONNECTION_TIMEOUT = 0 # Disable the busy timeout.
def tearDown(self):
unlink(TESTFN)