Skip to content

[sled-agent-sim] pause vmm_put_state, vmm_get_state, vmm_unregister - #11643

Merged
hawkw merged 2 commits into
mainfrom
eliza/pause-all-vmm-requests
Nov 3, 2026
Merged

hawkw merged 2 commits into
mainfrom
eliza/pause-all-vmm-requests

Conversation

@hawkw

@hawkw hawkw commented Oct 30, 2026

Copy link
Copy Markdown
Member

This commit generalizes the pause_next_vmm_registration API that I added to the sled-agent simulator in #11606 so that it can also be used to pause vmm_put_state and vmm_get_state requests to the sled-agent. This allows a test to wait for a request is received by the sled-agent and do other things (such as running sagas or background tasks, making assertions, and so on...) before resuming it or injecting an error. It factors out most of the machinery added in #11606 into a generalized VmmRequestPauseQueue, and adds such a queue for the vmm_put_state and vmm_get_state endpoints.

This obsoletes the previous set_instance_ensure_state_error API on the simulated sled-agent, which allowed setting an error that would be returned to vmm_put_state requests. The pause API can be used to inject errors similarly to that API, but allows more granular control. It lets the test wait for a request to be received, and can be used to inject an error into exactly one request, rather than "all requests while a flag is set". Therefore, I removed the old API in favor of this one, and updated the tests that were previously using it.

I wanted this to enable writing additional tests for changes to the instance-start saga I'm working on. In addition, while making this change, I noticed that the preexisting integration test test_instances_are_not_marked_failed_on_other_sled_agent_errors_by_instance_watcher (which I wrote, naturally) was also a bit wrong. It was using the set_instance_ensure_state_error sled-agent-sim API, which only sets an error for the vmm_put_state endpoint, and not the vmm_get_state endpoint that instance-watcher uses. So, the injected error was not actually being seen by the instance-watcher in that test. By replacing the use of the old API, this branch also fixes that test.

@hawkw
hawkw added this pull request to stack #11632 October 30, 2026 19:10
Base automatically changed from eliza/fix-11606 to main November 3, 2026 17:08
hawkw added 2 commits November 3, 2026 09:08
This commit generalizes the `pause_next_vmm_registration` API that I
added to the sled-agent simulator in #11606 so that it can also be used
to pause `vmm_put_state` and `vmm_get_state` requests to the sled-agent.
This allows a test to wait for a request is received by the sled-agent
and do other things (such as running sagas or background tasks, making
assertions, and so on...) before resuming it or injecting an error. It
factors out most of the machinery added in #11606 into a generalized
`VmmRequestPauseQueue`, and adds such a queue for the `vmm_put_state`
and `vmm_get_state` endpoints.

This obsoletes the previous `set_instance_ensure_state_error` API on the
simulated sled-agent, which allowed setting an error that would be
returned to `vmm_put_state` requests. The pause API can be used to
inject errors similarly to that API, but allows more granular control.
It lets the test wait for a request to be received, and can be used to
inject an error into exactly one request, rather than "all requests
while a flag is set". Therefore, I removed the old API in favor of this
one, and updated the tests that were previously using it.

I wanted this to enable writing additional tests for changes to the
`instance-start` saga I'm working on. In addition, while making this
change, I noticed that the preexisting integration test
`test_instances_are_not_marked_failed_on_other_sled_agent_errors_by_instance_watcher`
(which I wrote, naturally) was also a bit wrong. It was using the
`set_instance_ensure_state_error` sled-agent-sim API, which only sets an
error for the `vmm_put_state` endpoint, and **not** the `vmm_get_state`
endpoint that instance-watcher uses. So, the injected error was not
actually being seen by the instance-watcher in that test. By
replacing the use of the old API, this branch also fixes that test.
@hawkw
hawkw force-pushed the eliza/pause-all-vmm-requests branch from cc9ac1f to 819b04e Compare November 3, 2026 17:08
@hawkw hawkw changed the title [sled-agent-sim] pause vmm_put_state and vmm_get_state [sled-agent-sim] pause vmm_put_state, vmm_get_state, vmm_unregister Nov 3, 2026
@hawkw
hawkw merged commit eb2e28a into main Nov 3, 2026
19 checks passed
@hawkw
hawkw deleted the eliza/pause-all-vmm-requests branch November 3, 2026 18:12
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.

2 participants