Copilot commented on code in PR #13628:
URL: https://github.com/apache/cloudstack/pull/13628#discussion_r3595068951
##########
test/integration/smoke/test_nonstrict_affinity_group.py:
##########
@@ -209,6 +209,9 @@ def test_01_non_strict_host_anti_affinity(self):
vm_2_host_id,
msg="Both VMs of affinity group %s are on the same
host" % self.affinity_group.name)
+
+ time.sleep(10)
+
Review Comment:
Using a fixed sleep here makes the test slower and still flaky across
hypervisors (the VM may not yet be fully Running/ready for migration after 10s,
or may be ready much sooner). Prefer polling for the VM to reach Running (or
for a stable hostid) before attempting the migrate.
##########
test/integration/smoke/test_nonstrict_affinity_group.py:
##########
@@ -362,6 +365,8 @@ def test_02_non_strict_host_affinity(self):
vm_12_host_id,
msg="Both VMs of affinity group %s are on the
different host" % self.affinity_group.name)
+ time.sleep(10)
+
Review Comment:
Same as above: a fixed sleep is a brittle way to wait for the VM to become
migration-ready and unnecessarily increases suite runtime. Poll for the VM
reaching Running (or another concrete readiness signal) before migrating.
##########
test/integration/smoke/test_events_resource.py:
##########
@@ -147,16 +147,25 @@ def test_01_events_resource(self):
diskofferingid=self.disk_offering.id
)
self.cleanup.append(volume)
- virtual_machine.attach_volume(
- self.apiclient,
- volume
- )
+ try:
+ virtual_machine.attach_volume(
+ self.apiclient,
+ volume
+ )
Review Comment:
Catching all exceptions and continuing (with `print` + `pass`) can turn real
attach/detach failures into false positives and also makes the later
detach/delete steps ambiguous. If attach is optional here, track whether it
succeeded and only detach when attached; avoid `print` and log via the test
logger/debug instead.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]