Skip to content

GaveUpException

Rasuvaeff\PropertyTesting\GaveUpException

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

Extends: RuntimeException

Implements: Stringable, Throwable

Thrown (as the failure of a property) when discarded inputs exceed the configured budget before the requested number of successful checks completes.

It exposes successful, discarded and total attempt counts so the result cannot hide a weak input distribution.

The fix is almost always to construct valid inputs directly (e.g. Gen::flatMap() / Gen::draw()) rather than generating broadly and discarding, so runs are valid by construction.

Constructor

php
__construct(
    string $propertyName,
    int $requiredRuns,
    int $successfulRuns,
    int $discardedRuns,
    int $attempts,
    int $maxDiscards,
)
ParameterTypeDefaultDescription
$propertyNamestringrequired
$requiredRunsintrequired
$successfulRunsintrequired
$discardedRunsintrequired
$attemptsintrequired
$maxDiscardsintrequired