Problem/Motivation
https://www.drupal.org/pift-ci-job/37937
testContentAdminPages
fail: [Other] Line 137 of core/modules/node/src/Tests/NodeAdminTest.php:
Value 'Basic page' is equal to value 'Article'.
fail: [Other] Line 137 of core/modules/node/src/Tests/NodeAdminTest.php:
Value 'Article' is equal to value 'Basic page'.
Fail seems to be because "last modified" times are not different among the nodes, and default sorting may differ by DB
Proposed resolution
Add a query string to force ordering by title, or set the creation times to be distinct
Remaining tasks
decide correct approach to fix
User interface changes
n/a
API changes
n/a
Data model changes
n/a
Comments
Comment #2
pwolanin commentedHere's one possible fix.
Comment #3
pwolanin commentedHere's maybe an even easier fix.
I guess we were depending on a default ordering by Node ID?
Comment #4
dawehnerAny reason to not use REQUEST_TIME(), well I don't care at all.
Comment #5
dawehnerIt is the right thing to sort by changed explicit. It is kinda hard in how many places we have that kind of issues, sadly.
Comment #6
amateescu commented+1 for the patch in #3, I tested locally and it does fix the failure on SQLite.
Comment #7
pwolanin commentedComment #8
heddnQuestion: Is time() the typical way still in D8? Or should we use REQUEST_TIME?
Comment #9
dawehnerI actually think its better to use time(), because well, its kinda an implementation detail that we have new processes for those tests. They could also all be executed after each other,
so we better use the time NOW.
Comment #10
effulgentsia commentedPatch looks good, and I'll commit it in the next hour or so if no one complains about my code comment addition here.
I was confused initially by why we were decrementing $time (since time usually moves forward from one line of code to the next). Also, when Views is disabled, the admin/content page doesn't have a sort on node.changed (or if it does, its ASC). But this test enables Views, so that's fine, I just wanted to add the comment to help others looking at this code in the future.
Comment #11
effulgentsia commentedAdding credit to all participants, because every comment had an important consideration.
Comment #12
effulgentsia commentedRemoving trailing space from issue title.
Comment #13
effulgentsia commentedPushed to 8.0.x.