Class: Datadog::CI::TestRetries::Driver::RetryFlakyFixed
- Defined in:
- lib/datadog/ci/test_retries/driver/retry_flaky_fixed.rb
Instance Attribute Summary collapse
-
#max_attempts ⇒ Object
readonly
Returns the value of attribute max_attempts.
Instance Method Summary collapse
-
#initialize(max_attempts:) ⇒ RetryFlakyFixed
constructor
A new instance of RetryFlakyFixed.
- #record_retry(test_span) ⇒ Object
- #retry_reason ⇒ Object
- #should_retry? ⇒ Boolean
Methods inherited from Base
Constructor Details
#initialize(max_attempts:) ⇒ RetryFlakyFixed
Returns a new instance of RetryFlakyFixed.
14 15 16 17 |
# File 'lib/datadog/ci/test_retries/driver/retry_flaky_fixed.rb', line 14 def initialize(max_attempts:) @attempts = 0 @max_attempts = max_attempts end |
Instance Attribute Details
#max_attempts ⇒ Object (readonly)
Returns the value of attribute max_attempts.
12 13 14 |
# File 'lib/datadog/ci/test_retries/driver/retry_flaky_fixed.rb', line 12 def max_attempts @max_attempts end |
Instance Method Details
#record_retry(test_span) ⇒ Object
23 24 25 26 27 28 29 |
# File 'lib/datadog/ci/test_retries/driver/retry_flaky_fixed.rb', line 23 def record_retry(test_span) super @attempts += 1 Datadog.logger.debug { "Retry Attempts [#{@attempts} / #{@max_attempts}]" } end |
#retry_reason ⇒ Object
31 32 33 |
# File 'lib/datadog/ci/test_retries/driver/retry_flaky_fixed.rb', line 31 def retry_reason Ext::Test::RetryReason::RETRY_FLAKY_FIXED end |
#should_retry? ⇒ Boolean
19 20 21 |
# File 'lib/datadog/ci/test_retries/driver/retry_flaky_fixed.rb', line 19 def should_retry? @attempts < @max_attempts end |