Repository navigation
[sled-agent-sim] pause vmm_put_state, vmm_get_state, vmm_unregister - #11643
Merged
Merged
Conversation
jmpesp
approved these changes
Nov 2, 2026
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
force-pushed
the
eliza/pause-all-vmm-requests
branch
from
November 3, 2026 17:08
cc9ac1f to
819b04e
Compare
vmm_put_state and vmm_get_statevmm_put_state, vmm_get_state, vmm_unregister
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.
This commit generalizes the
pause_next_vmm_registrationAPI that I added to the sled-agent simulator in #11606 so that it can also be used to pausevmm_put_stateandvmm_get_staterequests 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 generalizedVmmRequestPauseQueue, and adds such a queue for thevmm_put_stateandvmm_get_stateendpoints.This obsoletes the previous
set_instance_ensure_state_errorAPI on the simulated sled-agent, which allowed setting an error that would be returned tovmm_put_staterequests. 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-startsaga I'm working on. In addition, while making this change, I noticed that the preexisting integration testtest_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 theset_instance_ensure_state_errorsled-agent-sim API, which only sets an error for thevmm_put_stateendpoint, and not thevmm_get_stateendpoint 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.