Skip to content

Fix flaky testExists by using deterministic key setup - #2827

Merged
michael-grunder merged 1 commit into
phpredis:developfrom
KentarouTakeda:fix-flaky-testExists
Apr 8, 2026
Merged

Fix flaky testExists by using deterministic key setup#2827
michael-grunder merged 1 commit into
phpredis:developfrom
KentarouTakeda:fix-flaky-testExists

Conversation

@KentarouTakeda

Copy link
Copy Markdown
Contributor

The test used rand() to decide which keys to create, making it possible for $mkeys to be empty. This caused EXISTS to receive an empty array, resulting in a sporadic assertion failure: (false) !== 0

Observed in #2825 CI and also in an unrelated branch:

The test used rand() to decide which keys to create, making it
possible for $mkeys to be empty. This caused EXISTS to receive an
empty array, resulting in a sporadic assertion failure:
(false) !== 0

Observed in phpredis#2825 CI and also in an unrelated branch:
- https://github.com/phpredis/phpredis/actions/runs/24132080914
- https://github.com/phpredis/phpredis/actions/runs/23617186872
@michael-grunder

Copy link
Copy Markdown
Member

Awesome, great find!

@michael-grunder
michael-grunder merged commit 82bf96c into phpredis:develop Apr 8, 2026
42 checks passed
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