Reschedule failing cron tasks progressively [MAILPOET-2181]

This commit is contained in:
wxa
2019-07-28 16:42:47 +03:00
committed by M. Shull
parent e1b8462254
commit 8b867a7b4f
9 changed files with 86 additions and 27 deletions

View File

@ -35,11 +35,14 @@ class KeyCheckWorkerTest extends \MailPoetTest {
'checkKey' => function () {
throw new \Exception;
},
'reschedule' => Expected::once(),
],
$this
);
$task = $this->createRunningTask();
$task = Stub::make(
ScheduledTask::class,
['rescheduleProgressively' => Expected::once()],
$this
);
$result = $worker->processTaskStrategy($task);
expect($result)->false();
}
@ -49,11 +52,14 @@ class KeyCheckWorkerTest extends \MailPoetTest {
$this->worker,
[
'checkKey' => ['code' => Bridge::CHECK_ERROR_UNAVAILABLE],
'reschedule' => Expected::once(),
],
$this
);
$task = $this->createRunningTask();
$task = Stub::make(
ScheduledTask::class,
['rescheduleProgressively' => Expected::once()],
$this
);
$result = $worker->processTaskStrategy($task);
expect($result)->false();
}