Skip to content

test: guard Linux-only Canvas backend cases on macOS - #6036

Merged
jpshackelford merged 1 commit into
mainfrom
fix-canvas-backend-tests-macos
Oct 16, 2026
Merged

jpshackelford merged 1 commit into
mainfrom
fix-canvas-backend-tests-macos

Conversation

@jpshackelford

@jpshackelford jpshackelford commented Oct 16, 2026 •

Copy link
Copy Markdown
Member

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 expect stopped and fail rather than skipping. Platform-neutral tests should still run.

Summary

  • Skip only tests that require a supported Linux backend artifact.
  • Add a non-Linux regression test covering unsupported status, 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

  • Bug fix

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

Variant Architectures Base Image Docs / Tags
java amd64, arm64 eclipse-temurin:17-jdk Link
python-slim amd64, arm64 python-node-runtime Link
python-minimal amd64, arm64 python-node-runtime Link
python amd64, arm64 python-node-runtime Link
golang amd64, arm64 golang:1.21-bookworm Link

Pull (multi-arch manifest)

# Each variant is a multi-arch manifest supporting both amd64 and arm64
docker pull ghcr.io/openhands/agent-server:8ecf11a-python

Run

docker run -it --rm \
  -p 8000:8000 \
  --name agent-server-8ecf11a-python \
  ghcr.io/openhands/agent-server:8ecf11a-python

All tags pushed for this build

ghcr.io/openhands/agent-server:8ecf11a-golang-amd64
ghcr.io/openhands/agent-server:8ecf11aafbd1527c534ac0293372fef45431b75e-golang-amd64
ghcr.io/openhands/agent-server:fix-canvas-backend-tests-macos-golang-amd64
ghcr.io/openhands/agent-server:8ecf11a-golang_tag_1.21-bookworm-amd64
ghcr.io/openhands/agent-server:8ecf11a-golang-arm64
ghcr.io/openhands/agent-server:8ecf11aafbd1527c534ac0293372fef45431b75e-golang-arm64
ghcr.io/openhands/agent-server:fix-canvas-backend-tests-macos-golang-arm64
ghcr.io/openhands/agent-server:8ecf11a-golang_tag_1.21-bookworm-arm64
ghcr.io/openhands/agent-server:8ecf11a-java-amd64
ghcr.io/openhands/agent-server:8ecf11aafbd1527c534ac0293372fef45431b75e-java-amd64
ghcr.io/openhands/agent-server:fix-canvas-backend-tests-macos-java-amd64
ghcr.io/openhands/agent-server:8ecf11a-eclipse-temurin_tag_17-jdk-amd64
ghcr.io/openhands/agent-server:8ecf11a-java-arm64
ghcr.io/openhands/agent-server:8ecf11aafbd1527c534ac0293372fef45431b75e-java-arm64
ghcr.io/openhands/agent-server:fix-canvas-backend-tests-macos-java-arm64
ghcr.io/openhands/agent-server:8ecf11a-eclipse-temurin_tag_17-jdk-arm64
ghcr.io/openhands/agent-server:8ecf11a-python-amd64
ghcr.io/openhands/agent-server:8ecf11aafbd1527c534ac0293372fef45431b75e-python-amd64
ghcr.io/openhands/agent-server:fix-canvas-backend-tests-macos-python-amd64
ghcr.io/openhands/agent-server:8ecf11a-python-node-runtime-amd64
ghcr.io/openhands/agent-server:8ecf11a-python-arm64
ghcr.io/openhands/agent-server:8ecf11aafbd1527c534ac0293372fef45431b75e-python-arm64
ghcr.io/openhands/agent-server:fix-canvas-backend-tests-macos-python-arm64
ghcr.io/openhands/agent-server:8ecf11a-python-node-runtime-arm64
ghcr.io/openhands/agent-server:8ecf11a-python-minimal-amd64
ghcr.io/openhands/agent-server:8ecf11aafbd1527c534ac0293372fef45431b75e-python-minimal-amd64
ghcr.io/openhands/agent-server:fix-canvas-backend-tests-macos-python-minimal-amd64
ghcr.io/openhands/agent-server:8ecf11a-python-node-runtime-minimal-amd64
ghcr.io/openhands/agent-server:8ecf11a-python-minimal-arm64
ghcr.io/openhands/agent-server:8ecf11aafbd1527c534ac0293372fef45431b75e-python-minimal-arm64
ghcr.io/openhands/agent-server:fix-canvas-backend-tests-macos-python-minimal-arm64
ghcr.io/openhands/agent-server:8ecf11a-python-node-runtime-minimal-arm64
ghcr.io/openhands/agent-server:8ecf11a-python-slim-amd64
ghcr.io/openhands/agent-server:8ecf11aafbd1527c534ac0293372fef45431b75e-python-slim-amd64
ghcr.io/openhands/agent-server:fix-canvas-backend-tests-macos-python-slim-amd64
ghcr.io/openhands/agent-server:8ecf11a-python-node-runtime-slim-amd64
ghcr.io/openhands/agent-server:8ecf11a-python-slim-arm64
ghcr.io/openhands/agent-server:8ecf11aafbd1527c534ac0293372fef45431b75e-python-slim-arm64
ghcr.io/openhands/agent-server:fix-canvas-backend-tests-macos-python-slim-arm64
ghcr.io/openhands/agent-server:8ecf11a-python-node-runtime-slim-arm64
ghcr.io/openhands/agent-server:8ecf11a-golang
ghcr.io/openhands/agent-server:8ecf11aafbd1527c534ac0293372fef45431b75e-golang
ghcr.io/openhands/agent-server:fix-canvas-backend-tests-macos-golang
ghcr.io/openhands/agent-server:8ecf11a-golang_tag_1.21-bookworm
ghcr.io/openhands/agent-server:8ecf11a-java
ghcr.io/openhands/agent-server:8ecf11aafbd1527c534ac0293372fef45431b75e-java
ghcr.io/openhands/agent-server:fix-canvas-backend-tests-macos-java
ghcr.io/openhands/agent-server:8ecf11a-eclipse-temurin_tag_17-jdk
ghcr.io/openhands/agent-server:8ecf11a-python-minimal
ghcr.io/openhands/agent-server:8ecf11aafbd1527c534ac0293372fef45431b75e-python-minimal
ghcr.io/openhands/agent-server:fix-canvas-backend-tests-macos-python-minimal
ghcr.io/openhands/agent-server:8ecf11a-python-node-runtime-minimal
ghcr.io/openhands/agent-server:8ecf11a-python-slim
ghcr.io/openhands/agent-server:8ecf11aafbd1527c534ac0293372fef45431b75e-python-slim
ghcr.io/openhands/agent-server:fix-canvas-backend-tests-macos-python-slim
ghcr.io/openhands/agent-server:8ecf11a-python-node-runtime-slim
ghcr.io/openhands/agent-server:8ecf11a-python
ghcr.io/openhands/agent-server:8ecf11aafbd1527c534ac0293372fef45431b75e-python
ghcr.io/openhands/agent-server:fix-canvas-backend-tests-macos-python
ghcr.io/openhands/agent-server:8ecf11a-python-node-runtime

About Multi-Architecture Support

  • Each variant tag (e.g., 8ecf11a-python) is a multi-arch manifest supporting both amd64 and arm64
  • Docker automatically pulls the correct architecture for your platform
  • Individual architecture tags (e.g., 8ecf11a-python-amd64) are also available if needed

Co-authored-by: openhands <openhands@all-hands.dev>
@github-actions

Copy link
Copy Markdown
Contributor

REST API breakage checks (OpenAPI) — ✅ PASSED

Result: ✅ PASSED

Action log

@github-actions

Copy link
Copy Markdown
Contributor

Coverage

Coverage Report •
FileStmtsMissCoverMissing
TOTAL502882007160% 
report-only-changed-files is enabled. No changed files were found in the coverage report :)

@jpshackelford
jpshackelford marked this pull request as ready for review October 16, 2026 20:17

@all-hands-bot all-hands-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 return Darwin): the backend module reports 3 passed, 14 skipped, and the whole tests/agent_server/canvas_extensions directory 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), so start() never reaches ready. The new test is correctly skipped here.
  • Current-head checks are green: the only failing run, Validate PR description at 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

@jpshackelford
jpshackelford merged commit bf9b605 into main Oct 16, 2026
53 of 54 checks passed
@jpshackelford
jpshackelford deleted the fix-canvas-backend-tests-macos branch October 16, 2026 22:35
enyst pushed a commit that referenced this pull request Oct 17, 2026
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants