Modify ↓
#11592 closed defect (fixed)
Unit test execution is slow with real SQLite database
Reported by: | Ryan J Ollos | Owned by: | Jun Omae |
---|---|---|---|
Priority: | low | Milestone: | 1.0.2 |
Component: | general | Version: | 1.0-stable |
Severity: | normal | Keywords: | unit tests sqlite |
Cc: | Branch: | ||
Release Notes: |
Reduced unit-test execution time when using SQLite database. |
||
API Changes: | |||
Internal Changes: |
Description
First mentioned in comment:20:ticket:11512, here is what I get on 1.0-stable
$ make unit-testPython version: Python 2.7.4 figleaf: coverage: PYTHONPATH=.: TRAC_TEST_DB_URI= server-options= -p 8000 -a '*,~/tracenvs/htdigest.realm,realm' -r -e ~/tracenvs python setup.py egg_info running egg_info writing requirements to Trac.egg-info/requires.txt writing Trac.egg-info/PKG-INFO writing top-level names to Trac.egg-info/top_level.txt writing dependency_links to Trac.egg-info/dependency_links.txt writing entry points to Trac.egg-info/entry_points.txt reading manifest file 'Trac.egg-info/SOURCES.txt' writing manifest file 'Trac.egg-info/SOURCES.txt' python ./trac/test.py --skip-functional-tests ... Ran 1545 tests in 37.987s OK $ make db=sqlite unit-test Python version: Python 2.7.4 figleaf: coverage: PYTHONPATH=.: TRAC_TEST_DB_URI=sqlite:test.db server-options= -p 8000 -a '*,~/tracenvs/htdigest.realm,realm' -r -e ~/tracenvs python setup.py egg_info running egg_info writing requirements to Trac.egg-info/requires.txt writing Trac.egg-info/PKG-INFO writing top-level names to Trac.egg-info/top_level.txt writing dependency_links to Trac.egg-info/dependency_links.txt writing entry points to Trac.egg-info/entry_points.txt reading manifest file 'Trac.egg-info/SOURCES.txt' writing manifest file 'Trac.egg-info/SOURCES.txt' python ./trac/test.py --skip-functional-tests ... Ran 1545 tests in 82.705s OK
The results seem to be the same on 0.12-stable with and without db=sqlite
.
Attachments (0)
Change History (6)
comment:1 by , 10 years ago
comment:2 by , 10 years ago
Priority: | normal → low |
---|---|
Status: | new → assigned |
Version: | → 1.0-stable |
comment:3 by , 10 years ago
Results of timing on my system.
SQLite database | Elapse |
---|---|
in-memory | 21.978s |
file on tmpfs | 20.745s |
file on ext4 with the changes | 22.692s |
file on ext4 without the changes | 800.592s |
comment:4 by , 10 years ago
Release Notes: | modified (diff) |
---|---|
Resolution: | → fixed |
Status: | assigned → closed |
comment:5 by , 10 years ago
Owner: | changed from | to
---|
comment:6 by , 10 years ago
Note:
See TracTickets
for help on using tickets.
On my system I consistently see 27 seconds for in-memory SQLite, 60 seconds with SQLite before change, < 30 seconds with SQLite after change. The execution times in comment:description are a little high since my system was doing other things at the same time.
I guess the setting is not persistent across database connections since the following change did not affect the execution time:
trac/test.py
I'll commit the changes in log:rjollos.git:t11592 to 1.0-stable if there is no additional feedback.