diff --git a/core/Command/TaskProcessing/WorkerCommand.php b/core/Command/TaskProcessing/WorkerCommand.php index 6f419daab3e..653945a9974 100644 --- a/core/Command/TaskProcessing/WorkerCommand.php +++ b/core/Command/TaskProcessing/WorkerCommand.php @@ -35,7 +35,7 @@ class WorkerCommand extends Base { 'timeout', 't', InputOption::VALUE_OPTIONAL, - 'Duration in seconds after which the worker exits (0 = run indefinitely)', + 'Duration in seconds after which the worker exits (0 = run indefinitely). You should regularly (e.g. every 5 minutes) restart this worker by using this option to make sure it picks up configuration changes.', 0 ) ->addOption( diff --git a/tests/Core/Command/TaskProcessing/WorkerCommandTest.php b/tests/Core/Command/TaskProcessing/WorkerCommandTest.php index a43f9b83f8f..2df0195d6a3 100644 --- a/tests/Core/Command/TaskProcessing/WorkerCommandTest.php +++ b/tests/Core/Command/TaskProcessing/WorkerCommandTest.php @@ -267,46 +267,6 @@ class WorkerCommandTest extends TestCase { $this->assertSame(0, $result); } - public function testPicksOldestTaskAcrossMultipleEligibleProviders(): void { - $taskTypeId1 = 'type_a'; - $taskTypeId2 = 'type_b'; - - $provider1 = $this->createProvider('provider_a', $taskTypeId1); - $provider2 = $this->createProvider('provider_b', $taskTypeId2); - // getNextScheduledTask returns a type_b task (the globally oldest one) - $task = $this->createTask(3, $taskTypeId2); - - $this->manager->expects($this->once()) - ->method('getProviders') - ->willReturn([$provider1, $provider2]); - - $this->manager->expects($this->exactly(2)) - ->method('getPreferredProvider') - ->willReturnMap([ - [$taskTypeId1, $provider1], - [$taskTypeId2, $provider2], - ]); - - // Both eligible types are queried together to prevent starvation - $this->manager->expects($this->once()) - ->method('getNextScheduledTask') - ->with($this->equalTo([$taskTypeId1, $taskTypeId2])) - ->willReturn($task); - - // provider2 must handle the task because the task has type_b - $this->manager->expects($this->once()) - ->method('processTask') - ->with($task, $provider2) - ->willReturn(true); - - $input = new ArrayInput(['--once' => true], $this->command->getDefinition()); - $output = new NullOutput(); - - $result = $this->command->run($input, $output); - - $this->assertSame(0, $result); - } - public function testTaskTypesWhitelistFiltersProviders(): void { $taskTypeId1 = 'type_a'; $taskTypeId2 = 'type_b';