- Issue created by @megachriz
- First commit to issue fork.
- @acbramley opened merge request.
- Status changed to Needs review
almost 2 years ago 10:57pm 19 March 2023 - π¦πΊAustralia acbramley
Failing test + fix pushed as separate commits. We were dropping keys at 2 steps - in the array_filter and the array_map. I've removed all of that and imo made this a bit easier to read through by iterating directly on
$this->queueManager->getDefinitions()
- Status changed to RTBC
almost 2 years ago 7:36pm 20 March 2023 - πΊπΈUnited States smustgrave
Thanks @acbramley for getting to this so quickly!
Change looks good and the test case appears to cover the scenario exactly.
Verified by install dev branch of the feeds module.
Setup a simple feed importer that reads a csv and creates an Article with the title mapping.
Ran cron and got the errorApplied the patch
Ran cron again, no error, and my page was created.
- π³π±Netherlands megachriz
When I run the test without the fix I get indeed the expected test failure:
Drupal\Tests\system\Kernel\System\CronQueueTest::testQueueWorkerDeriver
Drupal\Component\Plugin\Exception\PluginNotFoundException: The "cron_queue_test_deriver" plugin does not exist. Valid plugin IDs for Drupal\Core\Queue\QueueWorkerManager are: cron_queue_test_requeue_exception, cron_queue_test_deriver:foo, cron_queue_test_deriver:bar, cron_queue_test_lease_time, cron_queue_test_suspend, cron_queue_test_exception, cron_queue_test_memory_delay_exception, cron_queue_test_database_delay_exceptionNice that the test checks how many times an item from the queue was processed.
And the applied fix makes the code of
\Drupal\Core\Cron::processQueues()
look a lot simpler too.And in π Drupal 10.1 compatibility Fixed I checked that with the fix to core applied if this makes the Feeds tests pass on Drupal 10.1.x again and they do!
RTBC++
-
larowlan β
committed f2e1e5c5 on 10.1.x
Issue #3348832 by acbramley, MegaChriz, smustgrave: Running cron queues...
-
larowlan β
committed f2e1e5c5 on 10.1.x
- Status changed to Fixed
over 1 year ago 4:55am 3 April 2023 - π¦πΊAustralia larowlan π¦πΊπ.au GMT+10
Fixed on commit, added a pre-condition just to be safe.
diff --git a/core/modules/system/tests/src/Kernel/System/CronQueueTest.php b/core/modules/system/tests/src/Kernel/System/CronQueueTest.php index 4bec9a7e07f..4e2f1e7858c 100644 --- a/core/modules/system/tests/src/Kernel/System/CronQueueTest.php +++ b/core/modules/system/tests/src/Kernel/System/CronQueueTest.php @@ -335,6 +335,7 @@ public function testQueueWorkerManagerSafeguard(): void { * Tests that cron queues from derivers work. */ public function testQueueWorkerDeriver(): void { + $this->assertEquals(0, \Drupal::state()->get(CronQueueTestDeriverQueue::PLUGIN_ID, 0)); $queue = \Drupal::queue(sprintf('%s:foo', CronQueueTestDeriverQueue::PLUGIN_ID)); $queue->createItem('foo');
Verified it still passed locally
phpunit -c app/core app/core/modules/system/tests/src/Kernel/System/CronQueueTest.php --filter=Deriver β³οΈ Bootstrapped tests in 0 seconds. π PHP Version 8.1.16. π§ Drupal Version 10.1.0-dev. ποΈ Database engine mysql. PHPUnit 9.6.6 by Sebastian Bergmann and contributors. Testing Drupal\Tests\system\Kernel\System\CronQueueTest . 1 / 1 (100%) Time: 00:00.535, Memory: 10.00 MB OK (1 test, 4 assertions)
Automatically closed - issue fixed for 2 weeks with no activity.