MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / wait_for_setting_value

Function wait_for_setting_value

e2e/rust/tests/settings_management.rs:94–116  ·  view source on GitHub ↗

Poll `settings get` until the expected value and scope appear for a key.

(
    sandbox_name: &str,
    key: &str,
    expected_value: &str,
    expected_scope: &str,
    timeout_duration: Duration,
)

Source from the content-addressed store, hash-verified

92
93/// Poll `settings get` until the expected value and scope appear for a key.
94async fn wait_for_setting_value(
95 sandbox_name: &str,
96 key: &str,
97 expected_value: &str,
98 expected_scope: &str,
99 timeout_duration: Duration,
100) {
101 let needle = format!("{key} = {expected_value} ({expected_scope})");
102 let start = Instant::now();
103 loop {
104 let result = run_cli(&["settings", "get", sandbox_name]).await;
105 if result.success && result.clean_output.contains(&needle) {
106 return;
107 }
108 if start.elapsed() > timeout_duration {
109 panic!(
110 "timed out after {:?} waiting for setting line '{needle}' in output:\n{}",
111 timeout_duration, result.clean_output
112 );
113 }
114 sleep(Duration::from_secs(1)).await;
115 }
116}
117
118#[tokio::test]
119async fn settings_global_override_round_trip() {

Callers 1

Calls 1

run_cliFunction · 0.70

Tested by

no test coverage detected