Fix multiple integration test issues - #740
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
The new skip condition is implemented via a brittle str(e) substring match that can break if ApiError formatting changes, risking continued test flakiness.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR updates the Linode VPU integration-test fixture to skip VPU tests when instance creation fails due to real-time VPU capacity shortages, even if the region availability endpoint reports the plan as available.
Changes:
- Wrap VPU instance creation in a
try/except ApiErrorblock. - Skip the VPU test session when the API indicates the selected VPU plan is not available in the chosen region.
File summaries
| File | Description |
|---|---|
| test/integration/models/linode/test_linode.py | Adds defensive skip logic around VPU instance creation to avoid false failures when VPU capacity is exhausted. |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
🔵 Needs a closer look
The new polling uses wait_for_condition (which raises on timeout), making the subsequent asserts unreachable and reducing test failure clarity unless adjusted.
Review details
Suppressed comments (2)
test/integration/models/linode/test_linode.py:1046
wait_for_conditionraisesTimeoutErroron failure, so the subsequentassert matched_ip is not Noneis unreachable and you lose the more specific failure message about which IP was missing. Catch the timeout and raise an assertion with the test-specific context instead.
matched_ip = wait_for_condition(5, 120, resolve_vpc_ip)
assert (
matched_ip is not None
), f"Expected VPC IP {vpc_ip.address} not found in /vpcs/ips"
test/integration/models/linode/test_linode.py:1077
- Same issue as above:
wait_for_conditionraisesTimeoutError, soassert matched_ipv6is unreachable and the test loses the helpful message identifying the Linode/VPC. Convert the timeout into an assertion with that context.
matched_ipv6 = wait_for_condition(5, 120, resolve_vpc_ipv6)
assert (
matched_ipv6
), f"No VPC IPv6 found for Linode {linode.id} in VPC {vpc.id}"
- Files reviewed: 2/2 changed files
- Comments generated: 0 new
- Review effort level: Lite
There was a problem hiding this comment.
🟢 Approval recommended
The changes are isolated to integration tests, align with existing test utilities (e.g., wait_for_condition), and improve stability without altering SDK runtime behavior.
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 0 new
- Review effort level: Lite
📝 Description
Fix integration test failures seeing in the CI workflow:
✔️ How to Test