Skip to content

fix(temp): use managed job tmp for isolated test runtime - #2278

Merged
jbeda merged 1 commit into
mainfrom
fix/managed-job-test-runtime
Oct 12, 2026
Merged

jbeda merged 1 commit into
mainfrom
fix/managed-job-test-runtime

Conversation

@jbeda

@jbeda jbeda commented Oct 12, 2026

Copy link
Copy Markdown
Contributor

Summary

Use the managed command/job lease's existing private tmp directory as the isolated command tests' XDG_RUNTIME_DIR, rather than falling back to a runtime directory nested beneath synthetic HOME.

The runner already publishes MECATL_TEST_TEMP_LEASE, and testhome.Run already selects <lease>/tmp for an accepted marker. The validator previously accepted only cmd-* leases, rejecting background job-* leases. It also required the namespace's gc.lock, coupling test-runtime placement to unrelated harness reaper bookkeeping.

  • Accept active cmd/job leases with matching path and manifest kind/ID.
  • Remove gc.lock from test-home marker validation; leave namespace initialization and garbage collection unchanged.
  • Preserve namespace, ownership, manifest, and active-lock checks, and explicitly require a private real tmp directory and private regular lease.lock.
  • Cover cmd/job runtime placement without gc.lock, HOME/XDG restoration, lease-owned cleanup, unsafe paths, manifest mismatches, and real background marker propagation. Wait for complete streamed output in the test fixture rather than assuming a single write.

No /worktrees UI changes or Darwin socket-fallback changes are included. This reduces socket-path nesting; it does not promise arbitrary-length managed roots will fit the platform's Unix-socket pathname limit.

Validation

Temp-only checkout, using managed Shell temporary storage:

  • task lint
  • task test
  • task test:race
  • go run ./cmd/mecademo — tool call, permission ask/approval, and final result
  • Focused race tests for managedtemp, testhome, and osfs, including manifest-ID mismatch
  • Previously failing embedded-startup smoke tests passed in a real managed background job
  • git diff --check

Panel review: Spec, Standards, Test adequacy, and Domain (security, architecture, library reuse, duplication) passed after adding the manifest-ID negative control. The foreign-owner test skips on unprivileged hosts where changing ownership is unavailable.

Accept active cmd and job test-home markers without depending on GC bookkeeping. Preserve lease validation and require private runtime destinations.

Co-authored-by: Mecatl <[email protected]>
@jbeda
jbeda merged commit f0534f8 into main Oct 12, 2026
34 checks passed
@jbeda
jbeda deleted the fix/managed-job-test-runtime branch October 12, 2026 22:30
@toolhive-release-app toolhive-release-app Bot mentioned this pull request Oct 13, 2026
2 tasks
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