Reviewed: https://review.opendev.org/c/openstack/nova/+/845922 Committed: https://opendev.org/openstack/nova/commit/ecc90f2e5544c6422d71e8f6994c932300c84750 Submitter: "Zuul (22348)" Branch: master
commit ecc90f2e5544c6422d71e8f6994c932300c84750 Author: Balazs Gibizer <[email protected]> Date: Wed Jun 15 13:13:20 2022 +0200 Make test_wait_for_instance_event_* test time independent I91c42af8226dc8607d86c52413924351ba0586ac introduced three test cases that unfortunately dependent on execution time. The code under test uses a StopWatch to measure execution time and include that in a log that is then assert by the test cases. This cases the test assertion of "0.00 seconds" to fail on a slow CI node. This patch removes the dependency towards StopWatch.elapsed to stabilize the tests. Closes-Bug: #1978817 Change-Id: Id1ba3a886cf2d31956fc8f51dc7de08a79b22922 ** Changed in: nova Status: In Progress => Fix Released -- You received this bug notification because you are a member of Yahoo! Engineering Team, which is subscribed to OpenStack Compute (nova). https://bugs.launchpad.net/bugs/1978817 Title: The test_wait_for_instance_event_multiple_events unit test is unstable Status in OpenStack Compute (nova): Fix Released Bug description: Traceback (most recent call last): File "/home/zuul/src/opendev.org/openstack/nova/nova/tests/unit/compute/test_virtapi.py", line 310, in test_wait_for_instance_event_multiple_events mock_log.warning.assert_called_once_with( File "/home/zuul/src/opendev.org/openstack/nova/.tox/py39/lib/python3.9/site-packages/mock/mock.py", line 926, in assert_called_once_with return self.assert_called_with(*args, **kwargs) File "/home/zuul/src/opendev.org/openstack/nova/.tox/py39/lib/python3.9/site-packages/mock/mock.py", line 913, in assert_called_with raise AssertionError(_error_message()) from cause AssertionError: expected call not found. Expected: warning('Timeout waiting for %(events)s for instance with vm_state %(vm_state)s and task_state %(task_state)s. Event states are: %(event_states)s', {'events': ['received-event', 'early-event', 'missing-event', 'received-but-not-waited-event', 'missing-but-not-waited-event'], 'vm_state': sentinel.vm_state, 'task_state': sentinel.task_state, 'event_states': 'received-event: received after waiting 0.00 seconds, early-event: received early, missing-event: timed out after 0.00 seconds, received-but-not-waited-event: received but not processed, missing-but-not-waited-event: expected but not received'}, instance=<Mock name='mock.instance' id='140120239250208'>) Actual: warning('Timeout waiting for %(events)s for instance with vm_state %(vm_state)s and task_state %(task_state)s. Event states are: %(event_states)s', {'events': ['received-event', 'early-event', 'missing-event', 'received-but-not-waited-event', 'missing-but-not-waited-event'], 'vm_state': sentinel.vm_state, 'task_state': sentinel.task_state, 'event_states': 'received-event: received after waiting 0.02 seconds, early-event: received early, missing-event: timed out after 0.00 seconds, received-but-not-waited-event: received but not processed, missing-but-not-waited-event: expected but not received'}, instance=<Mock name='mock.instance' id='140120239250208'>) The key difference is timing "waiting 0.02 seconds" vs "waiting 0.00 seconds" Example run: https://zuul.opendev.org/t/openstack/build/1c15873a574d402ca8364e5eaf7145b9 To manage notifications about this bug go to: https://bugs.launchpad.net/nova/+bug/1978817/+subscriptions -- Mailing list: https://launchpad.net/~yahoo-eng-team Post to : [email protected] Unsubscribe : https://launchpad.net/~yahoo-eng-team More help : https://help.launchpad.net/ListHelp

