class RetryableCallHandler implements CallHandler (View source)

Replaces RuntimeCallHandler with a retry feature All scenarios or features OPT-IN to retry behaviour with the @retry tag.

Note: most of this class is duplicated (sad face) due to final class

Traits

Helpers for working with steps

Constants

RETRY_TAG

Properties

protected int $retrySeconds

Methods

protected
ScenarioInterface
getStepScenario(FeatureNode $feature, NodeInterface $step)

Get scenario from step in a feature node See https://github.com/Behat/Behat/issues/653

protected
mixed
retryThrowable(callable $callback, int $timeout = 3)

Retry until no exceptions are thrown, or until $timeout seconds are reached.

protected
bool
stepHasTag(StepScope|ScenarioScope $event, string $tag)

Check if a step has a given tag

public
__construct(int $errorReportingLevel = E_ALL, int $retrySeconds = 3)

Initializes executor.

public
supportsCall(Call $call)

{@inheritdoc}

public
handleCall(Call $call)

{@inheritdoc}

public
bool
handleError(int $level, string $message, string $file, int $line)

Used as a custom error handler when step is running.

protected
bool
isCallRetryable(Call $call)

Determine if the call is retryable

Details

protected ScenarioInterface getStepScenario(FeatureNode $feature, NodeInterface $step)

Get scenario from step in a feature node See https://github.com/Behat/Behat/issues/653

Parameters

FeatureNode $feature
NodeInterface $step

Return Value

ScenarioInterface

protected mixed retryThrowable(callable $callback, int $timeout = 3)

Retry until no exceptions are thrown, or until $timeout seconds are reached.

If timeout reached, re-throws the first exception.

Parameters

callable $callback
int $timeout

Return Value

mixed

Exceptions

Exception

protected bool stepHasTag(StepScope|ScenarioScope $event, string $tag)

Check if a step has a given tag

Parameters

StepScope|ScenarioScope $event
string $tag

Return Value

bool

__construct(int $errorReportingLevel = E_ALL, int $retrySeconds = 3)

Initializes executor.

Parameters

int $errorReportingLevel
int $retrySeconds

supportsCall(Call $call)

{@inheritdoc}

Parameters

Call $call

handleCall(Call $call)

{@inheritdoc}

Parameters

Call $call

bool handleError(int $level, string $message, string $file, int $line)

Used as a custom error handler when step is running.

Parameters

int $level
string $message
string $file
int $line

Return Value

bool

Exceptions

CallErrorException

See also

set_error_handler()

protected bool isCallRetryable(Call $call)

Determine if the call is retryable

Parameters

Call $call

Return Value

bool