Make WordPress Core

Opened 8 weeks ago

Closed 5 weeks ago

#64142 closed defect (bug) (invalid)

Transients inconsistency since 6.9-beta1

Reported by: nico23's profile nico23 Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Cache API Keywords: reporter-feedback close
Focuses: tests Cc:

Description

I always have my GitHub actions run against the latest WP beta and RC version and since 4.9-beta1 this test fails:

https://github.com/nextgenthemes/advanced-responsive-video-embedder/blob/master/tests/tests-admin-fn-admin.php

1) Nextgenthemes\ARVE\Tests_Admin::test_transient_deletion
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'Deleted 2 transients.'
+'Deleted 1 transients.'

The function is here: https://github.com/nextgenthemes/advanced-responsive-video-embedder/blob/master/php/fn-cache.php#L171

Always passed the tests with every older WP version I tested this.

Attachments (1)

64142.php (2.3 KB) - added by jorbin 6 weeks ago.

Download all attachments as: .zip

Change History (8)

#1 @Presskopp
7 weeks ago

You mean 6.9 !?

#2 @jorbin
7 weeks ago

  • Milestone changed from Awaiting Review to 6.9

Based on the linked automated test, 6.9 seems like what was meant. That said, delete_transients isn't a core function. It looks like it's from your plugin.

Have you been running the tests verses trunk? If so, do you know which commit they started failing on.

#3 @nico23
7 weeks ago

  • Summary changed from Transients not get created or deleted since 4.9-beta to Transients not get created or deleted since 6.9-beta1

Yes, I meant 6.9-beta1.

And I know that function is not core, but something in core changed that made the test fail that all other WP versions tested OK with. The function carefully only selects the transients and uses the native delete_transient to delete them. I see no issue with the code that tested perfectly fine b4.

And yes, just tested against trunk, same issue, as expected.

#4 @nico23
7 weeks ago

  • Summary changed from Transients not get created or deleted since 6.9-beta1 to Transients inconsistency since 6.9-beta1

Actually, my tests were messed up, I had the expected and actual flipped, fixed it now. The issue is actually that it finds one transient more than expected.

It's the last assertion. There is supposed to be one transient left, but it says it deletes two. So the function trying to select the last transient apparently finds two.

There was 1 failure:

1) Nextgenthemes\ARVE\Tests_Admin::test_transient_deletion
Failed to delete transients with no prefix and no containing string.
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'Deleted 1 transients.'
+'Deleted 2 transients.'
Last edited 7 weeks ago by nico23 (previous) (diff)

@jorbin
6 weeks ago

#5 @jorbin
6 weeks ago

  • Keywords reporter-feedback close added

@nico23 I recreated your test and function in a standalone file with the hope of running git bisect to find where this may have broken things and it seems to be fixed now. Can you please verify on your end.

Using gitbisect, I was able to find [61076] to be the commit that fixed things. Based on that commit not touching transients and there being one more transient than expected found by the sql query, I think the issue is likely due to the assumption that there are no transients in the DB at the start of your test.

#6 @wildworks
5 weeks ago

I would like to confirm whether this issue has been fixed in 6.9 Beta3. Are there any steps we can follow to verify this?

#7 @peterwilsoncc
5 weeks ago

  • Milestone 6.9 deleted
  • Resolution set to invalid
  • Status changed from new to closed
  • Version trunk deleted

I repeated @jorbin's test using a the custom test file in this gist.

Following the changes to hoist styles in #64150 a transient is set by core, wp_core_block_css_files.

As the final assertion in the third party tests will delete all transients, I'm closing this as invalid as the test doesn't account for existing transients.

Note: See TracTickets for help on using tickets.