Skip to content

Commit 1580159

Browse files
committed
Be more lenient with test case timeouts
1 parent 383bc77 commit 1580159

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

tests/AsyncTaskTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -159,9 +159,9 @@ public function testAsyncTimeoutIgnoreErrors()
159159
@unlink($textFilePath);
160160
$timeoutTask = new TestTimeoutErrorTask($message, $textFilePath);
161161
$task = new AsyncTask($timeoutTask);
162-
$task->withTimeLimit(1)->start();
162+
$task->withTimeLimit(2)->start();
163163
// we wait for it to timeout
164-
$this->sleep(1);
164+
$this->sleep(2);
165165
// should have timed out
166166
$this->assertFileDoesNotExist($textFilePath, "The async task timeout handler was inappropriately triggered (PHP fatal errors should not trigger timeouts).");
167167
$this->assertNoNohupFile();
@@ -175,9 +175,9 @@ public function testAsyncTimeoutIgnoreNoProblem()
175175
@unlink($textFilePath);
176176
$timeoutTask = new TestTimeoutNoOpTask($message, $textFilePath);
177177
$task = new AsyncTask($timeoutTask);
178-
$task->withTimeLimit(1)->start();
178+
$task->withTimeLimit(2)->start();
179179
// we wait for it to timeout
180-
$this->sleep(1);
180+
$this->sleep(2);
181181
// should have timed out
182182
$this->assertFileDoesNotExist($textFilePath, "The async task timeout handler was inappropriately triggered (finishing a task before the time limit should not trigger timeouts).");
183183
$this->assertNoNohupFile();
@@ -201,9 +201,9 @@ public function testAsyncTimeoutIgnoreENotice()
201201
@unlink($textFilePath);
202202
$timeoutTask = new TestTimeoutENoticeTask($message, $textFilePath);
203203
$task = new AsyncTask($timeoutTask);
204-
$task->withTimeLimit(1)->start();
204+
$task->withTimeLimit(2)->start();
205205
// we wait for it to timeout
206-
$this->sleep(1);
206+
$this->sleep(2);
207207
// should have timed out
208208
$this->assertFileDoesNotExist($textFilePath, "The async task timeout handler was inappropriately triggered (E_NOTICE should not trigger timeouts).");
209209
$this->assertNoNohupFile();

0 commit comments

Comments
 (0)