Repository navigation
e2e: own the shared fakeagent build directory and clean it up (plan 056) - #669
Closed
andyrewlee wants to merge 1 commit into
Closed
andyrewlee wants to merge 1 commit into
andyrewlee wants to merge 1 commit into
Conversation
The shared fake-agent binary was built into an amux-fakeagent-* temp dir that nothing owned: failed builds leaked partial outputs and the successful binary outlived every test process. Give the fixture an owner: the injectable build helper removes its owned dir immediately on failure, and TestMain removes the successful build after m.Run() — guarded to the owned prefix so cleanup can never sweep an unrelated path, and idempotent so a second call is a no-op. The shared binary intentionally gets no per-test cleanup: the parallel raw-carriage-return fixture depends on it for the process lifetime. Gates: cleanup/fixture/race suites green; verify-loop green with both raw-agent tests; isolated tmux/e2e + devcheck assertions all pass — the only failures are the known ambient e2e flakes under host load (TempDir RemoveAll teardown, one wheel-coordinate delivery timing), each proven non-regressions by isolated reruns.
5 tasks done
Owner
Author
|
Superseded — content landed on main via merge 8580442 (plans/ scaffolding intentionally excluded). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Plan 056 of the advisor series. The shared e2e fake-agent binary was built into an
amux-fakeagent-*temp dir that nothing owned — failed builds leaked partial outputs and successful builds outlived every test process.buildFakeAgentBinary(destRoot, runBuild): injectable helper that creates an ownedamux-fakeagent-*dir, removes it immediately on build failure (partial outputs included), and keeps it on success so the shared binary stays available to every test in the process.cleanupBuiltFakeAgent/cleanupOwnedFakeAgentDir: process-level cleanup invoked fromTestMainafterm.Run()— guarded to the owned directory prefix (refuses unrelated paths), idempotent, no-op when nothing was built, and preserves the original test exit code.internal/e2e/fakeagent_cleanup_test.go: failure cleanup, deferred success cleanup, empty-path no-op, unexpected-path refusal with a sentinel preserved, and a subprocess lifecycle proof (private TMPDIR → helper build → path exists mid-test → gone after TestMain exit).The shared binary deliberately gets no per-test cleanup —
TestFakeAgentRecordsRawCarriageReturnruns in parallel and depends on it.Test plan
go test ./internal/e2e -run 'Test.*FakeAgent.*(Build|Cleanup)'— all green incl. subprocess lifecyclego test ./internal/e2e ./internal/e2e/fakeagent -run 'Test(FakeAgent|RecordStream|ReadyBanner|OpenLogFile)'— greengo test -race ./internal/e2e -run 'Test.*FakeAgent'— greenmake verify-loop— both raw-agent tests pass against the shared binarygo test ./internal/tmux ./internal/e2e -count=1— assertions all pass; only the known ambient flakes (TempDir teardown, wheel-timing) under host loadmake test-race-tmux,make devcheck— same ambient-flake caveatmake lint-strict-new— 0 issuesStacked on #668.