Skip to content

Commit

Permalink
Print scale output
Browse files Browse the repository at this point in the history
Signed-off-by: Xudong Sun <[email protected]>
  • Loading branch information
marshtompsxd committed Sep 13, 2023
1 parent 2a59bdc commit 7e83d41
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions e2e/src/zookeeper_e2e.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ pub async fn scaling_test(client: Client, zk_name: String) -> Result<(), Error>
let timeout = Duration::from_secs(360);
let start = Instant::now();
let sts_api: Api<StatefulSet> = Api::default_namespaced(client.clone());
Command::new("kubectl")
let scale_output = Command::new("kubectl")
.args([
"patch",
"zk",
Expand All @@ -169,7 +169,15 @@ pub async fn scaling_test(client: Client, zk_name: String) -> Result<(), Error>
"'[{\"op\": \"replace\", \"path\": \"/spec/replicas\", \"value\": 2}]'",
])
.output()
.expect("failed to run perf test pod");
.expect("failed to scale zk");
println!(
"scale output: {}",
String::from_utf8_lossy(&scale_output.stdout)
);
println!(
"scale error: {}",
String::from_utf8_lossy(&scale_output.stderr)
);

loop {
sleep(Duration::from_secs(5)).await;
Expand Down Expand Up @@ -230,7 +238,7 @@ pub async fn scaling_test(client: Client, zk_name: String) -> Result<(), Error>
"'[{\"op\": \"replace\", \"path\": \"/spec/replicas\", \"value\": 3}]'",
])
.output()
.expect("failed to run perf test pod");
.expect("failed to scale zk");

loop {
sleep(Duration::from_secs(5)).await;
Expand Down

0 comments on commit 7e83d41

Please sign in to comment.