Skip to content

Implement eventual consistency for flaky tests - #1110

Merged
jeromegamez merged 4 commits into
8.xfrom
eventual-consistency
Jul 18, 2026
Merged

Implement eventual consistency for flaky tests#1110
jeromegamez merged 4 commits into
8.xfrom
eventual-consistency

Conversation

@jeromegamez

@jeromegamez jeromegamez commented Jul 17, 2026

Copy link
Copy Markdown
Member

No description provided.

@jeromegamez
jeromegamez changed the base branch from 7.x to 8.x July 17, 2026 23:26
@jeromegamez
jeromegamez marked this pull request as ready for review July 17, 2026 23:26
@jeromegamez
jeromegamez requested a review from Copilot July 18, 2026 21:16

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds a reusable “eventual consistency” assertion helper for integration tests and applies it to previously flaky test cases (Messaging topic subscriptions and AppCheck replay protection) to reduce timing-related failures.

Changes:

  • Introduces IntegrationTestCase::assertEventually() to retry a boolean condition until a timeout.
  • Updates Messaging AppInstance topic subscription assertions to wait until expected subscription state is observed.
  • Refactors AppCheck replay-protection verification test to use assertEventually() instead of an ad-hoc retry loop.

Reviewed changes

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

File Description
tests/IntegrationTestCase.php Adds assertEventually() helper used to wait for eventually consistent state in integration tests.
tests/Integration/Messaging/AppInstanceTest.php Replaces immediate subscription assertions with a helper that retries until expected topic subscription states are visible.
tests/Integration/AppCheckTest.php Refactors replay-protection verification to use assertEventually() for eventual visibility of consumption state.

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

Comment thread tests/IntegrationTestCase.php Outdated
Comment thread tests/Integration/Messaging/AppInstanceTest.php
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@codecov

codecov Bot commented Jul 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

Impacted file tree graph

@@             Coverage Diff              @@
##               8.x    #1110       +/-   ##
============================================
+ Coverage     1.67%   40.10%   +38.43%     
  Complexity    1486     1486               
============================================
  Files          146      146               
  Lines         4187     4174       -13     
============================================
+ Hits            70     1674     +1604     
+ Misses        4117     2500     -1617     

@jeromegamez
jeromegamez merged commit d8268a3 into 8.x Jul 18, 2026
20 checks passed
@jeromegamez
jeromegamez deleted the eventual-consistency branch July 18, 2026 22:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants