Skip to content

Commit

Permalink
Chore: use different port for examples
Browse files Browse the repository at this point in the history
  • Loading branch information
drmingdrmer committed Feb 11, 2024
1 parent eb2c58a commit fad4d87
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions examples/raft-kv-rocksdb/tests/cluster/test_cluster.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,17 +57,17 @@ async fn test_cluster() -> Result<(), Box<dyn std::error::Error>> {

fn get_addr(node_id: u32) -> String {
match node_id {
1 => "127.0.0.1:21001".to_string(),
2 => "127.0.0.1:21002".to_string(),
3 => "127.0.0.1:21003".to_string(),
1 => "127.0.0.1:31001".to_string(),
2 => "127.0.0.1:31002".to_string(),
3 => "127.0.0.1:31003".to_string(),
_ => panic!("node not found"),
}
}
fn get_rpc_addr(node_id: u32) -> String {
match node_id {
1 => "127.0.0.1:22001".to_string(),
2 => "127.0.0.1:22002".to_string(),
3 => "127.0.0.1:22003".to_string(),
1 => "127.0.0.1:32001".to_string(),
2 => "127.0.0.1:32002".to_string(),
3 => "127.0.0.1:32003".to_string(),
_ => panic!("node not found"),
}
}
Expand Down Expand Up @@ -230,7 +230,7 @@ async fn test_cluster() -> Result<(), Box<dyn std::error::Error>> {
match x {
Err(e) => {
let s = e.to_string();
let expect_err:String = "error occur on remote peer 2: has to forward request to: Some(1), Some(Node { rpc_addr: \"127.0.0.1:22001\", api_addr: \"127.0.0.1:21001\" })".to_string();
let expect_err:String = "error occur on remote peer 2: has to forward request to: Some(1), Some(Node { rpc_addr: \"127.0.0.1:32001\", api_addr: \"127.0.0.1:31001\" })".to_string();

assert_eq!(s, expect_err);
}
Expand Down

0 comments on commit fad4d87

Please sign in to comment.