diff --git a/tests/Integration/Queue/ThrottlesExceptionsWithRedisTest.php b/tests/Integration/Queue/ThrottlesExceptionsWithRedisTest.php index 87a7af68a22c..358d0a8b2513 100644 --- a/tests/Integration/Queue/ThrottlesExceptionsWithRedisTest.php +++ b/tests/Integration/Queue/ThrottlesExceptionsWithRedisTest.php @@ -10,6 +10,7 @@ use Illuminate\Queue\CallQueuedHandler; use Illuminate\Queue\InteractsWithQueue; use Illuminate\Queue\Middleware\ThrottlesExceptionsWithRedis; +use Illuminate\Support\Carbon; use Illuminate\Support\Str; use Mockery as m; use Orchestra\Testbench\TestCase; @@ -23,6 +24,8 @@ protected function setUp(): void parent::setUp(); $this->setUpRedis(); + + Carbon::setTestNow(now()); } protected function tearDown(): void @@ -31,6 +34,8 @@ protected function tearDown(): void $this->tearDownRedis(); + Carbon::setTestNow(); + m::close(); } @@ -38,10 +43,7 @@ public function testCircuitIsOpenedForJobErrors() { $this->assertJobWasReleasedImmediately(CircuitBreakerWithRedisTestJob::class, $key = Str::random()); $this->assertJobWasReleasedImmediately(CircuitBreakerWithRedisTestJob::class, $key); - - retry(2, function () use ($key) { - $this->assertJobWasReleasedWithDelay(CircuitBreakerWithRedisTestJob::class, $key); - }); + $this->assertJobWasReleasedWithDelay(CircuitBreakerWithRedisTestJob::class, $key); } public function testCircuitStaysClosedForSuccessfulJobs() @@ -57,10 +59,7 @@ public function testCircuitResetsAfterSuccess() $this->assertJobRanSuccessfully(CircuitBreakerWithRedisSuccessfulJob::class, $key); $this->assertJobWasReleasedImmediately(CircuitBreakerWithRedisTestJob::class, $key); $this->assertJobWasReleasedImmediately(CircuitBreakerWithRedisTestJob::class, $key); - - retry(2, function () use ($key) { - $this->assertJobWasReleasedWithDelay(CircuitBreakerWithRedisTestJob::class, $key); - }); + $this->assertJobWasReleasedWithDelay(CircuitBreakerWithRedisTestJob::class, $key); } protected function assertJobWasReleasedImmediately($class, $key)