Class: Datadog::CI::TestRetries::Driver::RetryFlakyFixed
- Inherits:
-
Base
- Object
- Base
- Datadog::CI::TestRetries::Driver::RetryFlakyFixed
show all
- Defined in:
- lib/datadog/ci/test_retries/driver/retry_flaky_fixed.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Methods inherited from Base
#mark_as_retry, #record_duration
Constructor Details
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
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
|
#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
|