From 7e83d4114cc88603fffbb18906c3a4e483148047 Mon Sep 17 00:00:00 2001 From: Xudong Sun Date: Tue, 12 Sep 2023 21:17:32 -0500 Subject: [PATCH] Print scale output Signed-off-by: Xudong Sun --- e2e/src/zookeeper_e2e.rs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/e2e/src/zookeeper_e2e.rs b/e2e/src/zookeeper_e2e.rs index 08cf2f633..6a04567e0 100644 --- a/e2e/src/zookeeper_e2e.rs +++ b/e2e/src/zookeeper_e2e.rs @@ -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 = Api::default_namespaced(client.clone()); - Command::new("kubectl") + let scale_output = Command::new("kubectl") .args([ "patch", "zk", @@ -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; @@ -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;