Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
\Drupal\Tests\user\Kernel\Views\HandlerFilterCurrentUserTest:: testFilterCurrentUserAsAnonymous() can randomly fail.
See https://www.drupal.org/pift-ci-job/1254268
1) Drupal\Tests\user\Kernel\Views\HandlerFilterCurrentUserTest::testFilterCurrentUserAsAnonymous
Anonymous account can view all accounts when current filter is FALSE.
Failed asserting that Array &0 (
0 => Array &1 (
'uid' => '3'
)
1 => Array &2 (
'uid' => '1'
)
2 => Array &3 (
'uid' => '2'
)
3 => Array &4 (
'uid' => '4'
)
) is identical to Array &0 (
0 => Array &1 (
'uid' => '1'
)
1 => Array &2 (
'uid' => '2'
)
2 => Array &3 (
'uid' => '3'
)
3 => Array &4 (
'uid' => '4'
)
).
Proposed resolution
Fix the code so the order is not an unstable sort (I guess)
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
Comment | File | Size | Author |
---|---|---|---|
#2 | 3046571-2.patch | 1.01 KB | Krzysztof Domański |
#2 | 3046571-2-test-only.patch | 1.01 KB | Krzysztof Domański |
Comments
Comment #2
Krzysztof Domański1. I added ascending sorting by uid to
test_filter_current_user
.2. Test only with descending sorting to make sure that sorting works.
Comment #4
dawehnerSorting is always a good thing! Thank you
Comment #5
Krzysztof DomańskiComment #6
alexpottCommitted and pushed 46b4700a89 to 8.8.x and 2a8794e465 to 8.7.x. Thanks!