Skip to content

TimeBudgetExceededException

Rasuvaeff\PropertyTesting\TimeBudgetExceededException

ClassPackage: property-testing-coreSourceVersion: v0.1.0-12-g86ead85

Extends: RuntimeException

Implements: Stringable, Throwable

Thrown (as the failure of a property) when the random phase's wall-clock time exceeds the Property::$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