tempdir.path().display(), tempdir.path().display(), ord_args.join(" "), server_args.join(" "), ).to_args()) .env("ORD_INTEGRATION_TEST", "1") .current_dir(&tempdir) .spawn().unwrap(); for i in 0.. { match reqwest::blocking::get(format!("http://127.0.0.1:{port}/status")) { Ok(_) => break, Err(err) => { if i == 400 { panic!("Server failed to start: {err}"); } } } thread::sleep(Duration::from_millis(25)); } Self { child, tempdir, port, rpc_url: rpc_server.url(), } } pub(crate) fn url(&self) -> Url { format!("http://127.0.0.1:{}", self.port).parse().unwrap() } pub(crate) fn assert_response_regex(&self, path: impl AsRef, regex: impl AsRef) { self.sync_server(); let response = reqwest::blocking::get(self.url().join(path.as_ref()).unwrap()).unwrap(); assert_eq!(response.status(), StatusCode::OK); assert_regex_match!(response.text().unwrap(), regex.as_ref());