Skip to content

Conversation

@jeherve
Copy link
Member

@jeherve jeherve commented Jan 6, 2026

Fixes #2723

Proposed changes:

Update tests to work regardless of the month (see #2723)

Other information:

  • Have you written new tests for your changes, if applicable?

Testing instructions:

  • Do the tests pass?

Changelog entry

  • Automatically create a changelog entry from the details below.
Changelog Entry Details

Significance

  • Patch
  • Minor
  • Major

Type

  • Added - for new features
  • Changed - for changes in existing functionality
  • Deprecated - for soon-to-be removed features
  • Removed - for now removed features
  • Fixed - for any bug fixes
  • Security - in case of vulnerabilities

Message

Copilot AI review requested due to automatic review settings January 6, 2026 10:56
@jeherve jeherve self-assigned this Jan 6, 2026
@jeherve jeherve requested a review from a team January 6, 2026 10:57
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a flaky test issue in test_purge_ap_posts_more_than_200_posts caused by month duration variations. The test was using -1 month to create posts that should be kept (newer than 30 days), but this could produce dates older than 30 days when run on certain days of the month (e.g., January 31st producing December 31st).

Key changes:

  • Updated comments to accurately reflect the 30-day purge threshold (was incorrectly documented as "6 months")
  • Changed date for posts that should be kept from -1 month to -1 week to ensure they are always within the 30-day threshold

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
tests/phpunit/tests/includes/class-test-scheduler.php Fixed flaky test by updating comments to reflect accurate 30-day threshold and changing test date from -1 month to -1 week to avoid month boundary issues
.github/changelog/fix-purge-ap-posts-test-date-boundary Added changelog entry documenting the test fix

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@jeherve jeherve merged commit 9f4543d into trunk Jan 7, 2026
16 checks passed
@jeherve jeherve deleted the fix/purge-ap-posts-test-date-boundary branch January 7, 2026 08:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tests: test_purge_ap_posts_more_than_200_posts fails due to date boundary condition

3 participants