Skip to content

Conversation

@marcelklehr
Copy link
Member

@marcelklehr marcelklehr commented May 20, 2025

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

@marcelklehr marcelklehr requested review from janepie and julien-nc May 20, 2025 16:42
@marcelklehr marcelklehr requested a review from a team as a code owner May 20, 2025 16:42
@marcelklehr marcelklehr requested review from ArtificialOwl, nfebe and sorbaugh and removed request for a team May 20, 2025 16:42
Copy link
Member

@ChristophWurst ChristophWurst left a 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 :)

Copy link
Member

@julien-nc julien-nc left a 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: 👍

@marcelklehr marcelklehr force-pushed the feat/setupcheck-task-pickup-speed branch 2 times, most recently from 038149d to 3832197 Compare May 22, 2025 10:16
@marcelklehr marcelklehr enabled auto-merge May 22, 2025 10:18
Copy link
Member

@ChristophWurst ChristophWurst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

Comment on lines +40 to +72
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());
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👏

@ChristophWurst ChristophWurst added enhancement 4. to release Ready to be released and/or waiting for tests to finish feature: settings labels May 22, 2025
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
@marcelklehr marcelklehr force-pushed the feat/setupcheck-task-pickup-speed branch from 3832197 to f8f2695 Compare May 22, 2025 10:50
@marcelklehr marcelklehr merged commit 1015b7c into master May 22, 2025
203 of 205 checks passed
@marcelklehr marcelklehr deleted the feat/setupcheck-task-pickup-speed branch May 22, 2025 11:28
@nickvergessen
Copy link
Member

If backported, #53068 also needs backporting

@marcelklehr
Copy link
Member Author

/backport to stable31

@marcelklehr
Copy link
Member Author

/backport to stable30

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

4. to release Ready to be released and/or waiting for tests to finish enhancement feature: settings

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants