Commit 4fa833a
authored
fix: wait for VM running after updating runStrategy to Always (#4272)
##### Short description:
- Fix `test_run_strategy_pause_unpause_vmi` failure caused by fixture
ordering change in #3847
- Add `running_vm()` call in `updated_vm_run_strategy` after setting the
strategy to `Always`, ensuring the VM is fully running before returning.
This centralizes the fix so all callers benefit.
assisted-by: Gemini
##### More details:
PR #3847 moved `start_vm_if_not_running` from function argument to
`@pytest.mark.usefixtures`, which changed the fixture execution order.
`start_vm_if_not_running` now runs **before**
`request_updated_vm_run_strategy`, so when the strategy changes to
`Always`, the VM is stopped and auto-restarts, but the test proceeds
before the VM is ready, resulting in a 409 Conflict ("VM is not
running") on pause.
##### What this PR does / why we need it:
##### Which issue(s) this PR fixes:
##### Special notes for reviewer:
##### jira-ticket:
<!-- full-ticket-url needs to be provided. This would add a link to the
pull request to the jira and close it when the pull request is merged
If the task is not tracked by a Jira ticket, just write "NONE".
-->
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Tests**
* Improved VM run-strategy tests to include an additional
synchronization when setting the strategy to ALWAYS, verifying the VM
reaches the running state.
* Retained existing test behavior for other strategies, including
verifying proper stop/start transitions where applicable.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Signed-off-by: Sibo Wang <siwang@redhat.com>1 parent c3fdc06 commit 4fa833a
1 file changed
+3
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
105 | 108 | | |
106 | 109 | | |
107 | 110 | | |
| |||
0 commit comments