Module: OpsManagerUiDrivers::WaitHelper

Included in:
PageHelpers, Version14::ProductDashboard::ApplyUpdatesResult
Defined in:
lib/ops_manager_ui_drivers/wait_helper.rb

Constant Summary collapse

SLEEP_INTERVAL =
0.5
EarlyFailException =
Class.new(Exception)

Instance Method Summary collapse

Instance Method Details

#fail_early(msg) ⇒ Object



11
12
13
# File 'lib/ops_manager_ui_drivers/wait_helper.rb', line 11

def fail_early(msg)
  fail(EarlyFailException.new(msg))
end

#poll_up_to_mins(minutes, sleep_interval = SLEEP_INTERVAL, &blk) ⇒ Object



15
16
17
18
19
20
21
22
# File 'lib/ops_manager_ui_drivers/wait_helper.rb', line 15

def poll_up_to_mins(minutes, sleep_interval = SLEEP_INTERVAL, &blk)
  title = "Polling for #{minutes} mins"

  Logger.debug "--- BEGIN #{title}"
  retry_until(minutes_to_time(minutes), sleep_interval, &blk)
ensure
  Logger.debug "--- END   #{title}"
end

#poll_up_to_times(times, sleep_interval = SLEEP_INTERVAL, &blk) ⇒ Object



24
25
26
27
28
29
30
31
# File 'lib/ops_manager_ui_drivers/wait_helper.rb', line 24

def poll_up_to_times(times, sleep_interval = SLEEP_INTERVAL, &blk)
  title = "Polling for #{times} times"

  Logger.debug "--- BEGIN #{title}"
  retry_times(times, sleep_interval, &blk)
ensure
  Logger.debug "--- END   #{title}"
end