-
-
Couldn't load subscription status.
- Fork 4.6k
feat(SetupChecks): Add check for TaskProcessing pickup speed #53001
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! A bit of test coverage wouldn't hurt :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with the suggested change.
Other than that: 👍
038149d to
3832197
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
![]()
| public function testPass(): void { | ||
| $tasks = []; | ||
| for ($i = 0; $i < 100; $i++) { | ||
| $task = new Task('test', ['test' => 'test'], 'settings', 'user' . $i); | ||
| $task->setStartedAt(0); | ||
| if ($i < 15) { | ||
| $task->setScheduledAt(60 * 5); // 15% get 5mins | ||
| } else { | ||
| $task->setScheduledAt(60); // the rest gets 1min | ||
| } | ||
| $tasks[] = $task; | ||
| } | ||
| $this->taskProcessingManager->method('getTasks')->willReturn($tasks); | ||
|
|
||
| $this->assertEquals(SetupResult::SUCCESS, $this->check->run()->getSeverity()); | ||
| } | ||
|
|
||
| public function testFail(): void { | ||
| $tasks = []; | ||
| for ($i = 0; $i < 100; $i++) { | ||
| $task = new Task('test', ['test' => 'test'], 'settings', 'user' . $i); | ||
| $task->setStartedAt(0); | ||
| if ($i < 30) { | ||
| $task->setScheduledAt(60 * 5); // 30% get 5mins | ||
| } else { | ||
| $task->setScheduledAt(60); // the rest gets 1min | ||
| } | ||
| $tasks[] = $task; | ||
| } | ||
| $this->taskProcessingManager->method('getTasks')->willReturn($tasks); | ||
|
|
||
| $this->assertEquals(SetupResult::WARNING, $this->check->run()->getSeverity()); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👏
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
3832197 to
f8f2695
Compare
|
If backported, #53068 also needs backporting |
|
/backport to stable31 |
|
/backport to stable30 |
Summary
A lot of people complain about slow AI task execution, which is usually due to slow pickup speed, which is usually due to people not setting up a worker, which is usually because people do not read the docs. So, let's tell them to read the docs if it becomes an issue.
Checklist