Skip to content

TimeBudgetExceededException ​

Rasuvaeff\PropertyTesting\TimeBudgetExceededException

Class — Package: property-testing-core — Source — Version: v1.0.0-1-g88fdee2

Extends: RuntimeException

Implements: Throwable, Stringable, PropertyTestingException

Thrown (as the failure of a property) when the random phase's wall-clock time exceeds the Runner\PropertyConfig::$budgetMs budget before the requested number of successful checks completes. It exposes the completed and required run counts so a slow property cannot silently check less than it claims.

The fix is to raise the budget, lower the run count, or speed up the property body (often by narrowing the generators).

Constructor ​

php
__construct(
    string $propertyName,
    int $budgetMs,
    float $elapsedMs,
    int $successfulRuns,
    int $requiredRuns,
)
ParameterTypeDefaultDescription
$propertyNamestringrequired
$budgetMsintrequiredThe configured whole-phase budget.
$elapsedMsfloatrequiredMeasured wall-clock duration of the phase so far.
$successfulRunsintrequired
$requiredRunsintrequired