Skip to content

fix: run functional tests on macOS docker desktop - #508

Merged
TerryHowe merged 1 commit into
mainfrom
fix/macos-functional-tests
Aug 3, 2026
Merged

TerryHowe merged 1 commit into
mainfrom
fix/macos-functional-tests

Conversation

@TerryHowe

Copy link
Copy Markdown
Owner

Summary

Two macOS-specific issues prevented tox -e py39 (the functional suite) from passing on Docker Desktop; both are fixed here. The suite now runs green end to end on macOS and remains unchanged for Linux CI.

1. Vault container wouldn't start (FAIL code 1)

functional/start.sh bind-mounted the vault config from a temp file in /tmp. Docker Desktop on macOS does not share /tmp, so the single-file mount silently became an empty directory inside the container, vault saw no config, and died with "A storage backend must be specified" — failing before any test ran.

Fix: pass the config through the VAULT_LOCAL_CONFIG env var instead of a bind mount, so no host path sharing is required.

2. Intermittent ASN1: NOT_ENOUGH_DATA in test_userpass_no_policy.yml

This was the only test using Ansible's uri module. Under OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES (set by tox) the module's Python ssl state gets corrupted across forks and every request to the plaintext vault port fails. A retry did not help — the corruption is persistent within the task.

Fix: shell out to curl for that raw POST (which the test's purpose — omitting the policies field — is well-suited to), sidestepping the broken Python-ssl-under-fork path.

Test plan

  • tox -e py39 → py39: OK / congratulations :) (full suite, fresh container) on macOS.

🤖 Generated with Claude Code

Docker Desktop on macOS does not share /tmp, so the single-file bind mount
of the vault config in start.sh silently became an empty directory in the
container and vault failed with "A storage backend must be specified".
Pass the config through VAULT_LOCAL_CONFIG instead so no host path sharing
is required; this works on both macOS and Linux CI.

test_userpass_no_policy.yml was the only test using the uri module, whose
Python ssl state gets corrupted under OBJC_DISABLE_INITIALIZE_FORK_SAFETY on
macOS, failing every request with "[ASN1: NOT_ENOUGH_DATA]". Shell out to
curl for that POST to avoid the broken code path.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Terry Howe <terrylhowe@gmail.com>
@TerryHowe
TerryHowe merged commit b2d0645 into main Aug 3, 2026
3 checks passed
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.

1 participant