Skip to content

Speed up sqlite3 tests #108550

Closed
Closed
@erlend-aasland

Description

@erlend-aasland

Feature or enhancement

Has this already been discussed elsewhere?

This is a minor feature, which does not need previous discussion elsewhere

Links to previous discussion of this feature:

No response

Proposal:

On my MacBook Pro M1, the sqlite3 test suite takes between 1.7 and up to 3 seconds to run. This is caused by the following inefficiencies:

  • the sqlite3 CLI tests are run by launching Python in a new process
  • tests relying on locking are using relatively large busy handler timeouts

With the following improvements, I can run the sqlite3 test suite in 350 milliseconds:

  • refactor the CLI so we can invoke it and mock command-line arguments simply by importing the main() and passing a list of strings to it
  • 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

Linked PRs

Metadata

Metadata

Labels

3.11only security fixes3.12only security fixes3.13bugs and security fixestestsTests in the Lib/test dirtype-featureA feature request or enhancement

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions