archive_deleted_rows_for_table relies on reflection to access the "default" for soft-delete columns, but this is not a server default
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Fix Released
|
Critical
|
Timofey Durakov |
Bug Description
Running subsets of Nova tests or individual tests within test_db_api reveals a simple error in several of the tests within ArchiveTestCase.
A test such as test_archive_
1. places six rows into instance_
2. places six rows into instances
3. runs the archive_
4. runs a SELECT of instances and instance_
Running this test directly with PYTHONHASHSEED=
Traceback (most recent call last):
File "/Users/
self.
File "/Users/
self.
File "/Users/
raise mismatch_error
testtools.
or
Traceback (most recent call last):
File "/Users/
self.
File "/Users/
self.
File "/Users/
raise mismatch_error
testtools.
The reason is that the archive_
ARCHIVED 4 ROWS FROM TABLE instances
ARCHIVED 3 ROWS FROM TABLE instance_types
Traceback (most recent call last):
...
testtools.
that is, the archiver locates seven rows just between instances and instance_types, then stops. It never even gets to the instance_
The serious problem with the way this test is designed, is that if we were to make it ignore only certain tables, or make the ordering fixed, or anything else, that will never keep the test from breaking again, any time a new table is added which contains rows when the test fixtures start.
The only solution to making these tests runnable in their current form is to limit the listing of tables that are searched in archive_
@require_
-def archive_
+def archive_
"""Move up to max_rows rows from production tables to the corresponding
shadow tables.
@@ -5870,6 +5870,9 @@ def archive_
if hasattr(
rows_archived = 0
+ if _limit_
+ tablenames = set(tablenames)
+
for tablename in tablenames:
Changed in nova: | |
milestone: | none → kilo-3 |
Changed in nova: | |
status: | Fix Committed → Fix Released |
Changed in nova: | |
milestone: | kilo-3 → 2015.1.0 |
console output illustrating a series of test runs of just the archive tests where non-deterministic failures are demonstrated.