You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
use phpmock\environment\SleepEnvironmentBuilder;
use phpmock\phpunit\PHPMock;
use PHPUnit\Framework\TestCase;
class DistributedMutexTest extends TestCase
{
use PHPMock;
#[\Override]
protected function setUp(): void
{
parent::setUp();
$sleepBuilder = new SleepEnvironmentBuilder();
$sleepBuilder->addNamespace(__NAMESPACE__);
$sleep = $sleepBuilder->build();
$sleep->enable();
$this->registerForTearDown($sleep);
global $i;
$i++;
}
}
repro code:
and
added in https://github.com/php-mock/php-mock/blob/2.5.1/classes/environment/MockEnvironment.php#L71
and PHPUnit launched with
--repeat 1000
Currently somethings like this is output:
confirming that the https://github.com/php-mock/php-mock/blob/2.5.1/classes/environment/MockEnvironment.php#L71 code needs to not only add the listener, but also wrap the
Deactivatable
instance which will remove the listener once called.The current implementation is slower with every test repeat and unusable with higher repeat counts.
The text was updated successfully, but these errors were encountered: