message: Add --duration to --health-check
  Closes:
  Closes:
  Approved by: ankushagarwal
diff: @@ -155,7 +155,8 @@ pub fn main() {
  let mut perf_msg = None;
  if args.health_check {
  - runner.run_health_check();
  + let duration = Duration::from_secs(args.duration);
  + exit_on_error(runner.run_health_check(duration));
  } else if args.perf_run {
  perf_msg = Some(runner.perf_run());
  } else if args.cleanup {
  @@ -738,16 +739,21 @@ impl ClusterTestRunner {
  Ok(())
  }
  - fn run_health_check(&mut self) {
  + fn run_health_check(&mut self, duration: Duration) -> Result<()> {
  + let health_check_deadline = Instant::now() + duration;
  loop {
  let deadline = Instant::now() + Duration::from_secs(1);
  // Receive all events that arrived to aws log tail within next 1 second
  // This assumes so far that event propagation time is << 1s, this need to be refined
  // in future to account for actual event propagation delay
  let events = self.logs.recv_all_until_deadline(deadline);
  - let _ignore =
  - self.health_check_runner
  + let result = self
  + .health_check_runner
  .run(&events, &HashSet::new(), PrintFailures::All);
  + let now = Instant::now();
  + if now > health_check_deadline {
  + return result.map(|_| ());
  + }
  }
  }
  