Parallel tests add all tests to one partition if test durations are 0
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Launchpad itself |
Triaged
|
Low
|
Unassigned | ||
Testrepository |
Fix Released
|
Critical
|
Unassigned |
Bug Description
This is really only particularly important if tests are miscalculated to take 0 seconds, which they have in the past.
In that case, all tests can be put in a single partition.
AFAIK, this is the sort of thing I think we want, modulo prejudices against lambda.
=== modified file 'testrepository
--- testrepository/
+++ testrepository/
@@ -208,10 +208,12 @@
# Scheduling is NP complete in general, so we avoid aiming for
# perfection. A quick approximation that is sufficient for our general
# needs:
- # sort the tests by time
+ # sort the tests by time, and then by len of the partition's tests.
# allocate to partitions by putting each test in to the partition with
# the current lowest time.
- queue = sorted(
+ queue = sorted(
+ key=lambda item: (item[1], -len(item[0])),
+ reverse=True)
for test_id, duration in queue:
Related branches
- testrepository committers: Pending requested
-
Diff: 66 lines (+31/-2)3 files modifiedNEWS (+6/-0)
testrepository/testcommand.py (+2/-2)
testrepository/tests/test_testcommand.py (+23/-0)
Changed in launchpad: | |
status: | New → Triaged |
importance: | Undecided → Low |
tags: | added: paralleltest |
Changed in testrepository: | |
status: | New → Triaged |
importance: | Undecided → Critical |
summary: |
- Parallel tests when partitions have equal times can fail to divide tests - equally + Parallel tests add all tests to one partition if test durations are 0 |
Changed in testrepository: | |
status: | Triaged → Fix Committed |
Changed in testrepository: | |
milestone: | none → next |
Changed in testrepository: | |
status: | Fix Committed → Fix Released |
For clarity, LP suffered from the 'tests get 0 duration' bug in an older testr; this led to a dual-core machine having a partition like:
[
[0][testa, testb]
]
rather than
[
[0][testa],
[0][testb],
]
which would parallelise better in this corner case.