The 'nova-manage db archive_deleted_rows --task-log' functional tests
involve manipulating time to assert archive behaviors when the --before
flag is also used.
While timedelta was used, set_time_override was not, so depending on
the date the test ran on + the number of days in the current month and
next two months, the test could fail. Task log audit periods are one
calendar month by default and the compute manager calls
last_completed_audit_period() without specifying a unit.
This changes the tests to use a time override to ensure predictable
behavior with regard to the audit period boundaries. The tests were
moved into their own test case classes in order to override the time
before services were started, so that the "service up" calculations
work as expected.
Reviewed: https:/ /review. opendev. org/c/openstack /nova/+ /800313 /opendev. org/openstack/ nova/commit/ 87dba379aca6ec4 613986cfa4e749a 3ada2b44d0
Committed: https:/
Submitter: "Zuul (22348)"
Branch: master
commit 87dba379aca6ec4 613986cfa4e749a 3ada2b44d0
Author: melanie witt <email address hidden>
Date: Fri Jul 9 22:22:15 2021 +0000
Make test_archive_ task_logs deterministic
The 'nova-manage db archive_ deleted_ rows --task-log' functional tests
involve manipulating time to assert archive behaviors when the --before
flag is also used.
While timedelta was used, set_time_override was not, so depending on completed_ audit_period( ) without specifying a unit.
the date the test ran on + the number of days in the current month and
next two months, the test could fail. Task log audit periods are one
calendar month by default and the compute manager calls
last_
This changes the tests to use a time override to ensure predictable
behavior with regard to the audit period boundaries. The tests were
moved into their own test case classes in order to override the time
before services were started, so that the "service up" calculations
work as expected.
Closes-Bug: #1934519
Change-Id: I9b16a3a849937a ba5b90ed1ab9a80 b7f0103f673