From 6737df5925ecfd653b2a7978b7d7c8b7a0be65f4 Mon Sep 17 00:00:00 2001 From: Daniel Mason Date: Mon, 20 Mar 2023 10:44:47 +1300 Subject: [PATCH] Add sleep for tests --- src/Resque/Stat.php | 2 +- tests/Resque/Tests/WorkerTest.php | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Resque/Stat.php b/src/Resque/Stat.php index 76bd069..45bfe45 100644 --- a/src/Resque/Stat.php +++ b/src/Resque/Stat.php @@ -71,6 +71,6 @@ class Stat */ public static function clear(string $stat): bool { - return (bool)Resque::redis()->unlink('stat:' . $stat); + return (bool)Resque::redis()->del('stat:' . $stat); } } diff --git a/tests/Resque/Tests/WorkerTest.php b/tests/Resque/Tests/WorkerTest.php index a8d0a69..e1b22e4 100644 --- a/tests/Resque/Tests/WorkerTest.php +++ b/tests/Resque/Tests/WorkerTest.php @@ -198,6 +198,9 @@ class WorkerTest extends TestCase $worker->work(0); $worker->work(0); + // Allow time for async unlink to work + sleep(2); + $this->assertEquals(0, $worker->getStat('processed')); $this->assertEquals(0, $worker->getStat('failed')); }