Problem/Motivation

#2133215: Fix IndexTidDepth views argument plugin and TaxonomyIndexTidDepth views filter plugin performance tweaked the queries for taxonomy depth filtering and now there is a random fail in \Drupal\Tests\taxonomy\Functional\Views\TaxonomyTermFilterDepthTest. See https://dispatcher.drupalci.org/job/drupal8_core_regression_tests/42560/

Fortunately we already fixed this for the kernel test so we can copy the same logic.

Proposed resolution

Copy the logic from \Drupal\Tests\taxonomy\Kernel\Views\TaxonomyTermFilterDepthTest

Note: this only occurs on 9.3.x because 2133215 has only been committed there

Remaining tasks

User interface changes

None

API changes

None

Data model changes

None

Release notes snippet

N/a

CommentFileSizeAuthor
#5 3229665.2_5.interdiff.txt808 bytesdww
#5 3229665-5.patch921 bytesdww
#2 3229665-2.patch913 bytesalexpott

Comments

alexpott created an issue. See original summary.

alexpott’s picture

Status: Active » Needs review
StatusFileSize
new913 bytes
alexpott’s picture

Issue tags: +Random test failure
alexpott’s picture

dww’s picture

Issue tags: +Bug Smash Initiative
StatusFileSize
new921 bytes
new808 bytes

Thanks for finding this, opening the issue, and fixing it!

Mostly looks good. But why keep calling getRequestTime() inside the loop? Why not do it once outside? Like so.

alexpott’s picture

@dww because it doesn't matter - it's only going to be called 6 or so times and the expense of PHP function calls is exaggerated. Mostly when people measure them the way they measure them gets in the way of measuring anything real. Plus as pointed out in the issue summary this is a copy/paste of existing code in an analogous kernel test so are we going to update both places. Doesn't feel worth it in my opinion. A review and rtbc so someone could commit this would be more valuable because then we'd be able to prevent tests failing because of random fails.

spokje’s picture

Status: Needs review » Reviewed & tested by the community

Let's meet in the middle (and make both of you unhappy... 😈)

I'll RTBC patch #2 since:

  • It's green
  • It copies existing logic
  • It prevents random fails on HEAD of 9.3.x

_and_ I'll create a follow-up where I create a patch applying the logic of patch #5 on both Kernel- and Functional test, which somebody then can/won't RTBC and we're done :)

spokje’s picture

dww’s picture

@alexpott: If I had a nickel for every time someone set a patch for 'needs work' for something minor like this, I'd be rich. 😉 I thought our relentless pursuit of perfection applied to everything, including micro optimizations in tests. I also thought it was better to make such minor suggestions in the form of a patch instead of a dreditor nitpick. I was about to solicit a quick/easy RTBC for this, but @Spokje beat me to it...

But sure. $RTBC++; for #2.

Thanks @Spokje for opening the follow-up. I just downgraded it to minor. 😉

Cheers,
-Derek

larowlan’s picture

Status: Reviewed & tested by the community » Fixed

Committed c63b2cc and pushed to 9.3.x. Thanks!

  • larowlan committed c63b2cc on 9.3.x
    Issue #3229665 by dww, alexpott, Spokje: \Drupal\Tests\taxonomy\...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.