-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: add a test cluster binary in
xline-test-utils
- Loading branch information
1 parent
17ba46b
commit c60a67d
Showing
2 changed files
with
20 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,4 +22,5 @@ tokio = { version = "1.0", features = [ | |
"fs", | ||
"macros", | ||
"net", | ||
"signal", | ||
] } |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
//! The binary is to quickly setup a cluster for convenient testing | ||
use tokio::signal; | ||
use xline_test_utils::Cluster; | ||
|
||
#[tokio::main] | ||
async fn main() { | ||
let mut cluster = Cluster::new(3).await; | ||
cluster.start().await; | ||
|
||
println!("cluster running"); | ||
|
||
for (id, addr) in cluster.addrs() { | ||
println!("server id: {} addr: {}", id, addr); | ||
} | ||
|
||
if let Err(e) = signal::ctrl_c().await { | ||
eprintln!("Unable to listen for shutdown signal: {e}"); | ||
} | ||
} |