Skip to content

Tests: Fix Flaky Subscriber Checks - #1183

Open
n7studios wants to merge 6 commits into
mainfrom
tests-fix-check-subscriber
Open

Tests: Fix Flaky Subscriber Checks#1183
n7studios wants to merge 6 commits into
mainfrom
tests-fix-check-subscriber

Conversation

@n7studios

@n7studios n7studios commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Summary

Tests failed intermittently on GitHub Actions when checking a subscriber was created. Kit's API is eventually consistent - searching by email after a write can take 30 seconds to 5 minutes to catch up, however tests search immediately, resulting in failures.

Fixes tests that only know the subscriber email by adding a test-only WordPress mu-plugin that:

  • Records the Kit API requests and responses
  • Extracts the ID from the log
  • Fetches the subscriber by ID vs. by email

Also fixes strict comparison of subscriber IDs against mixed types, and timeout being sent as a request header rather than a Guzzle option.

Testing

Existing tests pass.

Checklist

@n7studios n7studios self-assigned this Sep 8, 2026
@n7studios n7studios changed the title Tests: Wait for subscriber Tests: Wait for Subscriber Sep 8, 2026
Logs API requests to fetch the subscriber ID when creating a subscriber by email, so a lookup of the subscriber is faster
@n7studios n7studios changed the title Tests: Wait for Subscriber Tests: Fix Flaky Subscriber Checks Sep 8, 2026
@Kit Kit deleted a comment from github-actions Bot Sep 8, 2026
@Kit Kit deleted a comment from github-actions Bot Sep 8, 2026
@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown

WordPress Playground

🚀 Your PR has been built and is ready for testing in WordPress Playground!

Click here to test your changes in WordPress Playground

@n7studios
n7studios requested review from a team, ciccio-kit and noelherrick and removed request for a team September 8, 2026 11:44
@n7studios n7studios added this to the 3.4.1 milestone Sep 8, 2026
@n7studios
n7studios marked this pull request as ready for review September 8, 2026 11:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant