Skip to content

Commit

Permalink
feat: tmp
Browse files Browse the repository at this point in the history
  • Loading branch information
ryutamago committed Oct 8, 2024
1 parent 67bd553 commit 765ddd5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
12 changes: 12 additions & 0 deletions crates/jstzd/tests/octez_client_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,18 @@ async fn activate_protocol() {
));
assert!(response.contains("\"level\":1"));
let _ = octez_node.kill().await;
// Wait for the process to shutdown entirely
let health_check_endpoint = format!("http://{}/health/ready", DEFAULT_RPC_ENDPOINT);
let node_destroyed = retry(10, 1000, || async {
let res = reqwest::get(&health_check_endpoint).await;
// Should get an error since the node should have been terminated
if let Err(e) = res {
return Ok(e.to_string().contains("Connection refused"));
}
Err(anyhow::anyhow!(""))
})
.await;
assert!(node_destroyed);
}

async fn spawn_octez_node() -> (octez_node::OctezNode, TempDir) {
Expand Down
1 change: 1 addition & 0 deletions crates/jstzd/tests/octez_node_test.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use jstzd::task::{octez_node, Task};
use serial_test::serial;
mod utils;
use utils::retry;

#[tokio::test(flavor = "multi_thread")]
Expand Down

0 comments on commit 765ddd5

Please sign in to comment.