Closed (fixed)
Project:
Drupal core
Version:
7.x-dev
Component:
system.module
Priority:
Major
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
15 Oct 2014 at 12:09 UTC
Updated:
18 May 2015 at 20:44 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
bzrudi71 commentedJust two fails in LocaleUpdateCronTest...
Comment #2
bzrudi71 commentedComment #3
jaredsmith commentedRe-ran the tests using the drupalci test infrastructure, with PHP 5.5 and PostgreSQL 9.1. Still seeing the same two failed tests.
Test run started:
Friday, February 13, 2015 - 16:16
Test summary
------------
Drupal\locale\Tests\LocaleConfigManagerTest 5 passes
Drupal\locale\Tests\LocaleConfigTranslationImportTest 30 passes
Drupal\locale\Tests\LocaleConfigSubscriberTest 87 passes
Drupal\locale\Tests\LocaleConfigTranslationTest 93 passes
Drupal\locale\Tests\LocaleJavascriptTranslationTest 46 passes
Drupal\locale\Tests\LocaleExportTest 59 passes
Drupal\locale\Tests\LocaleLibraryAlterTest 2 passes
Drupal\locale\Tests\LocaleContentTest 128 passes
Drupal\locale\Tests\LocaleLocaleLookupTest 22 passes
Drupal\locale\Tests\LocalePathTest 47 passes
Drupal\locale\Tests\LocaleStringTest 28 passes
Drupal\locale\Tests\LocaleTranslatedSchemaDefinitionTest 18 passes
Drupal\locale\Tests\LocaleTranslationProjectsTest 4 passes
Drupal\locale\Tests\LocaleTranslateStringTourTest 22 passes
Drupal\locale\Tests\LocalePluralFormatTest 184 passes
Drupal\locale\Tests\LocaleUpdateCronTest 50 passes 2 fails
Drupal\locale\Tests\LocaleUpdateInterfaceTest 58 passes
Drupal\locale\Tests\LocaleImportFunctionalTest 321 passes
Drupal\locale\Tests\LocaleTranslationUiTest 338 passes
Drupal\locale\Tests\LocaleUpdateTest 427 passes
Test run duration: 8 min 28 sec
Comment #4
jaredsmith commentedThe two failing tests in LocaleUpdateCronTest are because the timestamps aren't being properly updated in the database during this test. Still trying to figure out why, but it seems to be the call to the
db_mergefunction in thelocale_translation_update_file_historyfunction that's not working correctly.I've got limited connectivity right now (as I'm on an airplane, and will be traveling all day), but maybe someone can take a look at db_merge and ensure it's working as it should in PostgreSQL. If not, I'll continue to look at it as soon as I'm able.
Comment #5
bzrudi71 commented@jaredsmith: Based on your information I tried to trace this down. In addition to this, I found out that we have a fail in the
itself, so I looked at this first.
With the help of some debug I hopefully found the (tricky) root cause in
Drupal\Core\Queue\QueueInterface::claimItem(). The claimItem() method returns the items ordered by creation time. And this is not save, as all items in test are created within the same second and get the same unix time timestamp. I changed the order to make use the item_id as argument and this seems to work now.Let's see if the attached patch works for MySQL also, and if so we need to test this on PG bot too.
Thanks!
Comment #6
bzrudi71 commentedWe have pass for MySQL, so changed issue summary to explain the problem in detail.
Comment #7
bzrudi71 commentedNice, patch makes tests pass on PG bot now, so please review.
Comment #8
tstoecklerI think in general (and conceptually) ordering by created makes sense (thinking of a FIFO queue) so maybe we can order by created first and then by item_id?
Comment #9
bzrudi71 commentedSure we can. Changed issue summary to reflect the now additionally order by item_id.
Comment #10
jaredsmith commentedDCI_PHPVERSION=5.5
DCI_DRUPALBRANCH=8.0.x
DCI_TESTGROUPS=locale
DCI_UPDATEREPO=TRUE
DCI_DBTYPE=pgsql
DCI_DBVER=9.1
DCI_PATCH=https://www.drupal.org/files/issues/claim-item-2.patch
Reviewed and tested both manually and with the drupalci infrastructure support for pgsql. With the patch from #2356983-9: Fix SystemQueue::claimItem() returns items in the wrong order (resolves locale test failures on PostgreSQL), all tests pass on PostgreSQL using the above parameters. Setting as RTBC, as it's a simple one-line patch and obviously does the right thing with queues.
Comment #11
webchickCommitted and pushed to 8.0.x. Thanks!
Comment #14
dave reidThis should have been marked for backport for Drupal 7, I've encountered queue items being processed out of order when they all contain the same timestamp as well.
Comment #15
jaredsmith commentedPatch in comment 14 works as expected. I think this is ready to be committed to the 7.x branch now as well.
Comment #16
dave reidRe-titling to be more clear this is a bug in the queue, not necessarily PostgreSQL or locale tests.
Comment #17
David_Rothstein commentedCommitted to 7.x - thanks!