sleep as little as possible in time-critical tests

This commit is contained in:
Spine
2025-07-28 16:55:16 +02:00
parent 1fbf231c6c
commit 82376f08df
6 changed files with 9 additions and 9 deletions
+1 -1
View File
@@ -257,7 +257,7 @@ class RequestTest extends TestCase {
// race condition between requests.LastPostTime and requests.created that would be
// difficult to remove without adding a lot of complications to the code.
$this->assertFalse($this->request->hasNewVote(), 'request-no-new-vote');
sleep(1); // to ensure lastVoteDate() > created()
Helper::sleepTick(); // to ensure lastVoteDate() > created()
// add some bounty
$this->assertTrue($this->request->vote($user, $bounty), 'request-more-bounty');
$this->assertTrue($this->request->hasNewVote(), 'request-has-new-vote');