Make WordPress Core

Opened 13 months ago

Closed 12 months ago

Last modified 10 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.


13 months ago
#1

  • Keywords has-patch has-unit-tests added

#2 @jorbin
12 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
12 months ago

added teardown

#4 @jorbin
12 months ago

  • Milestone changed from Awaiting Review to 6.5

Milestoning for commit.

#5 @jorbin
12 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
11 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:


11 months ago
#7

Thanks for the PR! This was merged in r57224.

#8 @SergeyBiryukov
10 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.