Add sleep for tests

This commit is contained in:
Daniel Mason 2023-03-20 10:44:47 +13:00
parent 94cae8d271
commit 6737df5925
2 changed files with 4 additions and 1 deletions

View File

@ -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);
}
}

View File

@ -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'));
}