Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #51109, comment 1


Ignore:
Timestamp:
08/23/2020 03:48:07 AM (4 years ago)
Author:
SergeyBiryukov
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #51109, comment 1

    initial v1  
    11If looks like [48840] is not the culprit per se, it just uncovered the fact that the failing test was fragile in the first place.
    22
    3 Specifically, the test ensures that metadata for an orphan term is not lazy loaded, because it's not attached to any posts. However, but the time the test runs, the `WP_Metadata_Lazyloader` queue contains quite a few IDs from previous tests, one of which can coincide with the orphan term ID from this test. When that happens, the term meta is retrieved from the cache and not from the database, as the test attempts to verify.
     3Specifically, the test ensures that metadata for an orphan term is not lazy loaded, because it's not attached to any posts. However, by the time the test runs, the `WP_Metadata_Lazyloader` queue contains quite a few IDs from previous tests, one of which can coincide with the orphan term ID from this test. When that happens, the term meta is retrieved from the cache and not from the database, as the test attempts to verify.
    44
    55Clearing the lazyloader queue at the beginning of the test appears to resolve the issue.