selftest --parallel test case timings incorrect
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Bazaar |
Fix Released
|
Medium
|
Martin Packman | ||
testtools |
Fix Released
|
Undecided
|
Martin Packman |
Bug Description
Individual test timings appear to be completely off when selftest is run across multiple processes.
Running two reasonably slow tests:
blackbox.
blackbox.
---
Ran 2 tests in 1.000s
But with --parallel=
blackbox.
blackbox.
---
Ran 2 tests in 3.531s
The timer is doing *something* as occasionally it thinks a test takes 15ms rather than 0ms, but clearly this is not actually timing how long the test is taking.
Does --parallel=fork have a similar issue? It appears to be using the same subunit.
Related branches
- Vincent Ladeuil: Approve
-
Diff: 48 lines (+18/-2)2 files modifiedbzrlib/tests/__init__.py (+3/-2)
bzrlib/tests/test_selftest.py (+15/-0)
- Robert Collins: Approve
- Vincent Ladeuil: Approve
-
Diff: 170 lines (+59/-43)4 files modifiedNEWS (+4/-0)
testtools/testresult/real.py (+36/-42)
testtools/tests/helpers.py (+4/-0)
testtools/tests/test_testresult.py (+15/-1)
Changed in bzr: | |
status: | Confirmed → In Progress |
Changed in testtools: | |
status: | Confirmed → In Progress |
Changed in testtools: | |
status: | In Progress → Fix Committed |
Changed in testtools: | |
milestone: | none → 0.9.7 |
Changed in testtools: | |
status: | Fix Committed → Fix Released |
This is what I get:
./bzr selftest -s blackbox. test_log. TestLogTags. test_log_ with_tags -s blackbox. test_log. TestLogTags. test_merged_ log_with_ tags -v src/bzr/ trunk :( $ ./bzr selftest -s bb.test_ log.TestLogTags .test_log_ with_tags -s bb.test_ log.TestLogTags .test_merged_ log_with_ tags -v src/bzr/ trunk/bzr vila/src/ bzr/trunk/ bzrlib 6.32-24- generic- x86_64- with-Ubuntu- 10.04-lucid
bzr: ERROR: blackbox is not a known test prefix alias
vila:~/
running 0 tests...
bzr selftest: /home/vila/
/home/
bzr-2.3.0dev1 python-2.6.5 Linux-2.
blackbox. test_log. TestLogTags. test_log_ with_tags OK 103ms test_log. TestLogTags. test_merged_ log_with_ tags OK 113ms ------- ------- ------- ------- ------- ------- ------- ------- -------
blackbox.
-------
Ran 2 tests in 0.221s
OK src/bzr/ trunk :) $ ./bzr selftest -s bb.test_ log.TestLogTags .test_log_ with_tags -s bb.test_ log.TestLogTags .test_merged_ log_with_ tags -v --parallel=fork src/bzr/ trunk/bzr vila/src/ bzr/trunk/ bzrlib 6.32-24- generic- x86_64- with-Ubuntu- 10.04-lucid
vila:~/
running 0 tests...
bzr selftest: /home/vila/
/home/
bzr-2.3.0dev1 python-2.6.5 Linux-2.
blackbox. test_log. TestLogTags. test_log_ with_tags OK 0ms test_log. TestLogTags. test_merged_ log_with_ tags OK 0ms ------- ------- ------- ------- ------- ------- ------- ------- -------
blackbox.
-------
Ran 2 tests in 0.168s
OK