mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2025-10-16 12:05:38 +00:00
Tests: Adjust the meta key time in wp_scheduled_delete() tests.
Occasionally, the tests verifying that old trashed posts or comments are not deleted if not old enough can take longer than expected, leading to false positives when comparing the timestamp in `wp_scheduled_delete()`, and resulting in subsequent test failures. This commit aims to resolve the race condition. Follow-up to [57224], [57237]. See #59938. git-svn-id: https://develop.svn.wordpress.org/trunk@57583 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
44a2073816
commit
fc4ad56061
@ -87,7 +87,7 @@ class Tests_Functions_wpScheduledDelete extends WP_UnitTestCase {
|
||||
'post_status' => 'trash',
|
||||
)
|
||||
);
|
||||
add_post_meta( self::$page_id, '_wp_trash_meta_time', time() - ( DAY_IN_SECONDS * EMPTY_TRASH_DAYS ) );
|
||||
add_post_meta( self::$page_id, '_wp_trash_meta_time', time() - ( DAY_IN_SECONDS * EMPTY_TRASH_DAYS - 1 ) );
|
||||
add_post_meta( self::$page_id, '_wp_trash_meta_status', 'published' );
|
||||
|
||||
$this->assertInstanceOf( 'WP_Post', get_post( self::$page_id ) );
|
||||
@ -157,7 +157,7 @@ class Tests_Functions_wpScheduledDelete extends WP_UnitTestCase {
|
||||
'comment_approved' => 'trash',
|
||||
)
|
||||
);
|
||||
add_comment_meta( self::$comment_id, '_wp_trash_meta_time', time() - ( DAY_IN_SECONDS * EMPTY_TRASH_DAYS ) );
|
||||
add_comment_meta( self::$comment_id, '_wp_trash_meta_time', time() - ( DAY_IN_SECONDS * EMPTY_TRASH_DAYS - 1 ) );
|
||||
add_comment_meta( self::$comment_id, '_wp_trash_meta_status', 'published' );
|
||||
|
||||
$this->assertInstanceOf( 'WP_Comment', get_comment( self::$comment_id ) );
|
||||
|
||||
Loading…
Reference in New Issue
Block a user