Skip to content

test(cache): run commands against the remote cache test server - #754

Merged
wan9chi merged 1 commit into
mainfrom
remote-cache-test-server
Sep 25, 2026
Merged

wan9chi merged 1 commit into
mainfrom
remote-cache-test-server

Conversation

@wan9chi

@wan9chi wan9chi commented Sep 24, 2026

Copy link
Copy Markdown
Member

Motivation

The remote cache client PRs stacked on this one need to run vp against the test backend, with uploads from one step visible to the next, for example to restore outputs after vp cache clean. The detached daemon needs explicit start and stop steps and loses its state on restart. Its fetch responses also differ from the server API in #713, which the client will implement.

remote-cache-server <command> [args...] starts the backend on a free loopback port under the /projects/test base path, runs the command with VP_REMOTE_CACHE_URL set to that endpoint, and exits with the command's exit code after stopping the server. The command inherits stdio, and the wrapper takes no options. State lives in remote-cache/ in the working directory: state.json holds entries, associations, and the next blob ID, and each blob is a file in blobs/ named by its ID. Consecutive steps share state, and blob IDs keep counting across invocations, so snapshots stay deterministic.

This removes start, stop, the daemon, cache.url, cache.log, the --base-path, --max-request-bytes, and --max-lifetime-ms options, and the request size limit. cbor-http joins its path onto VP_REMOTE_CACHE_URL, including the base path. As in #713, a fetch miss returns 200 {kind: "not_found"}, and a fallback returns {kind: "fallback", key, value, blob_id}.

The remote_cache_backend steps now run as remote-cache-server cbor-http .... The request_limit case is removed. daemon_lifecycle is replaced by state_across_invocations, and a new command_wrapper case covers the endpoint's base path and the exit code.

@wan9chi
wan9chi added this pull request to stack #751 September 24, 2026 17:43
@github-actions

github-actions Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

fspy benchmark

linux

dynamic/launch             change  +0.67%  [ -7.15% ..  +8.61%]  overhead  +288.03%
dynamic/access             change  -0.42%  [ -6.01% ..  +1.94%]  overhead   +12.95%
dynamic/access-relative    change  +0.13%  [ -8.50% .. +21.90%]  overhead   +62.97%
dynamic/access-contended   change  +3.70%  [ -6.68% .. +15.94%]  overhead   +15.45%
static/launch              change  +1.42%  [ -4.79% ..  +8.80%]  overhead  +690.81%
static/access              change  -0.38%  [-11.39% ..  +9.78%]  overhead  +837.60%
static/access-relative     change  +1.09%  [ -4.94% ..  +5.72%]  overhead +1244.27%
static/access-contended    change  +0.10%  [ -1.21% ..  +1.19%]  overhead +3157.87%

macos

dynamic/launch             change  +0.64%  [ -2.22% ..  +3.23%]  overhead  +211.51%
dynamic/access             change  -0.37%  [ -4.51% ..  +5.42%]  overhead    +8.82%
dynamic/access-relative    change  -0.34%  [ -2.22% ..  +2.28%]  overhead  +246.43%
dynamic/access-contended   change  +0.80%  [ -1.28% ..  +3.45%]  overhead    +4.26%

windows

dynamic/launch             change  -0.08%  [ -8.88% ..  +7.37%]  overhead   +24.99%
dynamic/access             change  -0.35%  [ -2.97% ..  +4.69%]  overhead    +1.40%
dynamic/access-relative    change  -0.17%  [-12.42% .. +13.06%]  overhead    +2.55%
dynamic/access-contended   change  +1.39%  [ -3.87% ..  +4.84%]  overhead    +3.47%

@wan9chi
wan9chi force-pushed the remote-cache-test-server branch from 866960a to ad5e614 Compare September 25, 2026 02:04
Base automatically changed from remote-cache-config to main September 25, 2026 02:13
`remote-cache-server <command> [args...]` starts the backend on a free
loopback port under the `/projects/test` base path, runs the command with
`VP_REMOTE_CACHE_URL` set to that endpoint, and exits with the command's
exit code after stopping the server. State lives in `remote-cache/` in the
working directory, so consecutive E2E steps share entries and blobs, and
blob IDs keep counting across invocations.

This replaces `start`, `stop`, the detached daemon, `cache.url`,
`cache.log`, the `--base-path`, `--max-request-bytes`, and
`--max-lifetime-ms` options, and the request size limit. `cbor-http` now
joins its path onto `VP_REMOTE_CACHE_URL`.

Fetch responses follow the server API in #713: a miss returns
`{kind: "not_found"}`, and a fallback also returns the entry's value and
blob ID.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
@wan9chi
wan9chi force-pushed the remote-cache-test-server branch from ad5e614 to 0439c07 Compare September 25, 2026 02:13
@wan9chi
wan9chi marked this pull request as ready for review September 25, 2026 02:27
@wan9chi
wan9chi merged commit 66bc0d2 into main Sep 25, 2026
19 checks passed
@wan9chi
wan9chi deleted the remote-cache-test-server branch September 25, 2026 02:27
wan9chi added a commit that referenced this pull request Sep 25, 2026
## Motivation

The remote cache test server from #754 handles cases the tests never
hit: signals sent to the wrapper, a missing command, spawn failures,
non-numeric blob IDs, and `cbor-http` calls with an absolute URL or
without `VP_REMOTE_CACHE_URL`. Test infra should only handle what the
tests exercise.

`remote-cache-server` now starts the server, runs the command, closes
the server, and exits with the command's exit code. The blob route and
state loading check whether the file exists. `cbor-http` always appends
its path to `VP_REMOTE_CACHE_URL`. The `command_wrapper` case goes away;
the other snapshots are unchanged.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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