diff options
author | Ben Burgess <88810029+bx80@users.noreply.github.com> | 2022-02-02 02:19:23 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-02 02:19:23 +0300 |
commit | f20c4cbed3de7f3fcc49810d5721b257d5a56d43 (patch) | |
tree | da362660970e784654bf9f5ec1d4a55755ed1322 /tests/PHPUnit/System | |
parent | cbb297de4aed974716dd03acfee8832565ebf133 (diff) |
Retry scheduled tasks on failure (#18335)
* Catch and log errors for scheduled tasks
* Added retry on exception mechanism for scheduled tasks
* Replace error code with custom exception
* Fix/workaround for SchedulerTest mock breaking retry list option loading
* Log warning instead of info if a task has failed three times
* Added basic tests, minor code improvements
* Test fix
* Fix for test
* Added integration test to check that only tasks that throw exceptions are scheduled for retry
Diffstat (limited to 'tests/PHPUnit/System')
-rw-r--r-- | tests/PHPUnit/System/TrackerTest.php | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/PHPUnit/System/TrackerTest.php b/tests/PHPUnit/System/TrackerTest.php index a675e045d0..592b65c75c 100644 --- a/tests/PHPUnit/System/TrackerTest.php +++ b/tests/PHPUnit/System/TrackerTest.php @@ -45,6 +45,7 @@ class TrackerTest extends IntegrationTestCase Option::delete(self::TASKS_STARTED_OPTION_NAME); Option::delete(self::TASKS_FINISHED_OPTION_NAME); Option::delete(Timetable::TIMETABLE_OPTION_STRING); + Option::delete(Timetable::RETRY_OPTION_STRING); SettingsPiwik::overwritePiwikUrl(self::$fixture->getRootUrl() . "tests/PHPUnit/proxy"); } @@ -399,7 +400,7 @@ class TrackerTest extends IntegrationTestCase $this->assertCustomTasksWereStarted(); Option::clearCachedOption(self::TASKS_FINISHED_OPTION_NAME); - $this->assertEmpty(Option::get(self::TASKS_FINISHED_OPTION_NAME)); + $this->assertFalse(Option::get(self::TASKS_FINISHED_OPTION_NAME)); } private function assertCustomTasksWereStarted() |