Repository navigation
test: guard Linux-only Canvas backend cases on macOS - #6036
Conversation
Co-authored-by: openhands <openhands@all-hands.dev>
REST API breakage checks (OpenAPI) — ✅ PASSEDResult: ✅ PASSED |
all-hands-bot
left a comment
There was a problem hiding this comment.
This review was posted by an AI agent (OpenHands).
Scope
Test-only change to tests/agent_server/canvas_extensions/test_canvas_extension_backend.py, which this repository owns (agent-server test suite). It belongs here; no cross-repository move or product decision is needed.
What the change does
Adds a requires_linux_backend skipif marker keyed on CanvasExtensionBackendManager.current_platform() is None, and applies it to the ten tests whose fixtures build backend-linux-amd64/arm64 artifacts and execute them via a Linux script shebang and /proc-based liveness checks. A new test_backend_is_unsupported_on_non_linux_platform asserts the unsupported status, prepare, and start paths on non-Linux hosts, and that no artifact is extracted.
I checked every test in the module against its fixtures: all tests that need a real Linux artifact are marked (test_prepare_start_logs_stop_and_preserve_data, test_ready_endpoint_closes_when_ready_backend_exits, test_prepare_rejects_revision_checksum_and_unsafe_archive, test_start_rejects_executable_that_resolves_outside_artifact, test_failed_start_cleanup_and_unsupported_states, test_status_reports_starting_and_stop_abandons_hung_backend, test_status_recovers_after_one_slow_health_probe, test_exited_leader_descendant_does_not_block_recovery, test_cleanup_kills_sigterm_ignoring_descendant, test_restart_after_server_crash_reaps_orphaned_backend, test_backend_http_lifecycle_and_data_deletion), while the two genuinely platform-neutral tests (test_remote_artifact_download_strip_cache_and_home, test_status_degrades_when_manifest_is_corrupted) stay unmarked and keep running off Linux. The marked set matches the code paths that reach _backend_parts(), _expand_argv(), subprocess launch, or /proc, so nothing Linux-dependent is left unguarded and nothing platform-neutral is wrongly skipped.
Verification
- Simulated non-Linux host (patched
platform.system()to returnDarwin): the backend module reports 3 passed, 14 skipped, and the wholetests/agent_server/canvas_extensionsdirectory reports 145 passed, 14 skipped. That matches the counts in the PR description exactly. - On this Linux sandbox the same module reports 12 failed, 4 passed, 1 skipped. Those failures are environmental, not caused by the diff: the fixture backends start with
#!/usr/bin/python3, which does not exist in this container (only/usr/local/bin/python3), sostart()never reachesready. The new test is correctly skipped here. - Current-head checks are green: the only failing run,
Validate PR descriptionat 20:17Z, was superseded by a passing run at 20:20Z, and I re-validated the current PR body with the repository's own.github/scripts/check_pr_description.py(no body errors, linked issue #5264 satisfies readiness).
Non-blocking observation
test_backend_is_unsupported_on_non_linux_platform is skipped on every CI job in this repository: agent-server-tests in tests.yml runs on blacksmith-2vcpu-ubuntu-2404, and the macOS/Windows legs (server.yml build-binary-and-test, tests.yml windows-tests) do not run tests/agent_server. The new regression test therefore protects local macOS developer runs only and gets no CI enforcement. That does not block this fix — the Linux lifecycle coverage is unaffected and the skip logic is the point of the change — but if CI enforcement of the non-Linux path is wanted, it would need a macOS runner that actually executes this suite.
No correctness, security, or compatibility defect found on the current head. The change reduces false failures without weakening Linux coverage.
✅ APPROVED
…upt-archive Also guard the new prepare tests with requires_linux_backend, like the Linux-only Canvas backend cases main guarded in #6036. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01S978x74H7Drsnw7bzoGWc8
HUMAN:
Tests requiring linux resources fail on MacOS instead of being skipped.
AGENT:
Why
Canvas backend integration tests use Linux amd64/arm64 artifacts. On macOS, the backend correctly reports
unsupported, but lifecycle tests expectstoppedand fail rather than skipping. Platform-neutral tests should still run.Summary
unsupportedstatus, prepare, and start without extracting an artifact.Issue Number
Related to #5264 (Canvas backend lifecycle, including explicit unsupported-platform behavior).
How to Test
On macOS, run
pytest -q tests/agent_server/canvas_extensions: 145 passed, 14 skipped. The backend test module alone reports 3 passed, 14 skipped. Ruff, pycodestyle, and changed-file pyright checks passed. Linux CI continues to run the lifecycle tests.Type
Notes
This change addresses only the Canvas backend test-platform mismatch; unrelated tmux socket-path and live-server fixture failures can still affect the full macOS suite.
This PR description was prepared by an AI agent (OpenHands) on behalf of the user, except for the HUMAN note provided by the user.
🐳 Agent Server images for this PR — GHCR package, pull/run commands, and all pushed tags (click to expand)
• GHCR package: https://github.com/OpenHands/agent-sdk/pkgs/container/agent-server
Variants & Base Images
eclipse-temurin:17-jdkpython-node-runtimepython-node-runtimepython-node-runtimegolang:1.21-bookwormPull (multi-arch manifest)
# Each variant is a multi-arch manifest supporting both amd64 and arm64 docker pull ghcr.io/openhands/agent-server:8ecf11a-pythonRun
All tags pushed for this build
About Multi-Architecture Support
8ecf11a-python) is a multi-arch manifest supporting both amd64 and arm648ecf11a-python-amd64) are also available if needed