Make WordPress Core

Opened 7 months ago

Closed 6 months ago

Last modified 4 months ago

#59938 closed defect (bug) (fixed)

phpUnit test for wpScheduledDelete

Reported by: pbearne's profile pbearne Owned by: jorbin's profile jorbin
Milestone: 6.5 Priority: normal
Severity: normal Version:
Component: Build/Test Tools Keywords: has-patch has-unit-tests
Focuses: Cc:

Description


Change History (8)

This ticket was mentioned in PR #5693 on WordPress/wordpress-develop by @pbearne.


7 months ago
#1

  • Keywords has-patch has-unit-tests added

#2 @jorbin
7 months ago

I think this might benefit from actual setup/teardown functions so that there is assurance that the posts/comments created are deleted regardless of test success.

#3 @pbearne
7 months ago

added teardown

#4 @jorbin
6 months ago

  • Milestone changed from Awaiting Review to 6.5

Milestoning for commit.

#5 @jorbin
6 months ago

  • Owner set to jorbin
  • Resolution set to fixed
  • Status changed from new to closed

In 57224:

Build/Test: Add Tests for wp_scheduled_delete.

Props pbearne.
Fixes #59938.

#6 @SergeyBiryukov
6 months ago

In 57237:

Tests: Use more specific assertions in wp_scheduled_delete() tests.

Includes clarifying test method names and descriptions.

Follow-up to [57224].

See #59938.

@SergeyBiryukov commented on PR #5693:


6 months ago
#7

Thanks for the PR! This was merged in r57224.

#8 @SergeyBiryukov
4 months ago

In 57583:

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.

Note: See TracTickets for help on using tickets.