We're already checking the size of the list, but we are accepting anything less than or equal to 7:
# Seven versioned notifications are generated. We only rely on the
# first six because _wait_until_swap_volume_error will return True
# after volume_api.unreserve is called on the cinder fixture, and that
# happens before the instance fault is handled in the compute manager
# which generates the last notification (compute.exception).
# 0. instance-create-start
# 1. instance-create-end
# 2. instance-update
# 3. instance-volume_attach-start
# 4. instance-volume_attach-end
# 5. instance-volume_swap-start
# 6. instance-volume_swap-error
# 7. compute.exception self.assertLessEqual(7, len(fake_notifier.VERSIONED_NOTIFICATIONS), 'Unexpected number of versioned notifications. ' 'Got: %s' % fake_notifier.VERSIONED_NOTIFICATIONS)
The difference since that bug was fixed is the check here:
https:/ /review. openstack. org/#/c/ 564092/ 16/nova/ tests/functiona l/notification_ sample_ tests/test_ instance. py@1348
We're already checking the size of the list, but we are accepting anything less than or equal to 7:
# Seven versioned notifications are generated. We only rely on the swap_volume_ error will return True api.unreserve is called on the cinder fixture, and that exception) . create- start volume_ attach- start volume_ attach- end volume_ swap-start volume_ swap-error
self.assertLes sEqual( 7, len(fake_ notifier. VERSIONED_ NOTIFICATIONS) ,
'Unexpected number of versioned notifications. '
'Got: %s' % fake_notifier. VERSIONED_ NOTIFICATIONS)
# first six because _wait_until_
# after volume_
# happens before the instance fault is handled in the compute manager
# which generates the last notification (compute.
# 0. instance-
# 1. instance-create-end
# 2. instance-update
# 3. instance-
# 4. instance-
# 5. instance-
# 6. instance-
# 7. compute.exception