Repository navigation
test(executorrpc): add an in-memory executor for the Files and Commands services - #2855
Merged
Merged
Conversation
blkt
marked this pull request as ready for review
November 18, 2026 08:12
blkt
force-pushed
the
feat/2691-inmem-executor
branch
from
November 18, 2026 09:03
611f8dc to
adb1696
Compare
rdimitrov
approved these changes
Nov 18, 2026
rdimitrov
left a comment
Member
There was a problem hiding this comment.
LGTM. Reusing the real fileserver/commandserver behind memfs and a scripted Runner keeps the fake on the production protocol, and the helpers cover the streaming, cancellation and unconfirmed-exit cases the work streams need. The notes on trivially-passing background-child scenarios and single-message reads are reasonable scope limits.
blkt
force-pushed
the
feat/2691-inmem-executor
branch
from
November 18, 2026 09:50
adb1696 to
9cdbe20
Compare
…ds services `memexecutor.Dial` serves `fileserver` over a `memfs` workspace and `commandserver` over a scripted `Runner` on one in-process listener, leaving a nil service unregistered. Tests run `fileconformance` and `commandconformance` through it and cover streaming, cancellation on call close, and unknown outcomes. Closes #2691
blkt
force-pushed
the
feat/2691-inmem-executor
branch
from
November 18, 2026 10:06
9cdbe20 to
066b8f5
Compare
blkt
enabled stacked auto-merge (squash)
November 18, 2026 10:06
Closed
Merged
2 tasks
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
A test-only in-memory executor, so each work stream can test against the executor contract without a real executor.
internal/executorrpc/memexecutor.DialservesFileServiceandCommandServiceon one bufconn listener and returns a client connection. A nil service inExecutorstays unregistered and answersUnimplemented.fileserverfrom feat(executorrpc): serveFileServicefrommecatl-executor serve#2853 over amemfsworkspace, withmemfs.ErrPathEscaperegistered as a path-escape error.Executor.FileOptionspassesfileserveroptions through.Runnerbehind the realcommandserver.Server, so the call protocol is the production one.Script(cmd, fn)andRefuse(cmd, err)set up commands; helpersExit,Stream,BlockandOutcomeUnknowncover output streaming, blocking until cancelled, and an exit whose cleanup is unconfirmed.Running()reports scripts still running.testing(likecommandconformance) and stays inside the existinginternal-executorrpcdepguard allowlist.Issue relationship
Closes #2691
Stacked on #2853 (#2694), which is stacked on #2832 (#2770); retarget to
mainonce those merge.Type of change
Test plan
Baseline checks
task lint)task test): covered bytask test:racetask test:race)go run ./cmd/mecademo): tool call, permission ask and approval, and result; the demo doesn't use this packagetask docs)task site:build)task api:check)task api:update+engine/CHANGELOG.mdAlso run:
go test -race -count=10 ./internal/executorrpc/memexecutor/. Acceptance criteria:TestFileServiceConformancerunsfileconformance.Run(fsconformanceRun,RunNamespace,RunMutationAffinity,RunExternalMutationConflict) throughDial, with thememfsworkspace as the external actor.TestCommandServiceConformancerunscommandconformance.Runagainst the scripted runner. Further tests cover chunks streamed before exit, closing the call cancelling the script and returningRunning()to 0,OUTCOME_UNKNOWNon a normal exit and afterCancelCommand, and refused or unscripted commands never starting.TestPathEscapeIsReportedfails if thememfs.ErrPathEscapemapping is removed;fileconformancealone doesn't notice.engine/,fileserverorfileconformancechanges.task check:prfails only onbuf breakingagainstmain, from the streaming RPCs in #2832; it clears once #2832 merges.Changes
internal/executorrpc/memexecutor/memexecutor.goExecutorandDialinternal/executorrpc/memexecutor/commands.goRunnerand script helpersinternal/executorrpc/memexecutor/commands_test.gocommandconformanceand Commands fake testsinternal/executorrpc/memexecutor/files_test.gofileconformancethroughDial, path escape, unregistered serviceUser-facing change
None.
Special notes for reviewers
commandconformance's background-child scenarios pass trivially here: the fake has no child process, so they only prove the script saw its context end. Real child cleanup stays covered bycommandserveragainst the real supervisor.fileconformanceread is a single message, becausefileserverfixes the read chunk at 3 MiB and the suite uses small files. A multi-message conformance run would need a chunk-size option infileserver; it was left out of scope.