Skip to content

Commit 6737df5

Browse files
committed
Add sleep for tests
1 parent 94cae8d commit 6737df5

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/Resque/Stat.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,6 @@ public static function decr(string $stat, int $by = 1): bool
7171
*/
7272
public static function clear(string $stat): bool
7373
{
74-
return (bool)Resque::redis()->unlink('stat:' . $stat);
74+
return (bool)Resque::redis()->del('stat:' . $stat);
7575
}
7676
}

tests/Resque/Tests/WorkerTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,9 @@ public function testWorkerErasesItsStatsWhenShutdown()
198198
$worker->work(0);
199199
$worker->work(0);
200200

201+
// Allow time for async unlink to work
202+
sleep(2);
203+
201204
$this->assertEquals(0, $worker->getStat('processed'));
202205
$this->assertEquals(0, $worker->getStat('failed'));
203206
}

0 commit comments

Comments
 (0)