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

Method wait_until_ready

e2e/rust/src/harness/container.rs:152–182  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

150 }
151
152 async fn wait_until_ready(&self) -> Result<(), String> {
153 let container_id = self.container_id.clone();
154 let engine = self.engine.clone();
155 timeout(Duration::from_secs(60), async move {
156 let mut tick = interval(Duration::from_millis(500));
157 loop {
158 tick.tick().await;
159 let output = engine
160 .command()
161 .args([
162 "exec",
163 &container_id,
164 "python3",
165 "-c",
166 "import urllib.request; urllib.request.urlopen('http://127.0.0.1:8000', timeout=1).read()",
167 ])
168 .output()
169 .ok();
170 if output.is_some_and(|o| o.status.success()) {
171 return;
172 }
173 }
174 })
175 .await
176 .map_err(|_| {
177 format!(
178 "{} test server did not become ready within 60s",
179 self.engine.name()
180 )
181 })
182 }
183}
184
185fn normalized_env(value: Option<&str>) -> Option<String> {

Callers 1

start_pythonMethod · 0.80

Calls 2

commandMethod · 0.80
successMethod · 0.45

Tested by

no test coverage detected