Skip to content

Conversation

@hank95179
Copy link
Contributor

@hank95179 hank95179 commented Dec 12, 2025

Description

This PR addresses the flakiness observed in test_zscan and test_sync_zscan.
The test seeds the database with two sets of data: a char_map (keys: 'a', 'b', 'c'...) and a large num_map (keys: 'value 0', 'value 1'...).
The previous assertion strictly required all items returned by zscan to start with "value". However, since zscan iterates through the set, it occasionally returns items from the char_map. When this happened, the strict assertion caused the test to fail incorrectly.

Solution

Updated the logic of zscan to only match results starting with value

Issue link

This Pull Request is linked to issue (URL): #4952

@hank95179 hank95179 requested a review from a team as a code owner December 12, 2025 08:15
…r_map keys

Signed-off-by: hank95179 <hank95179@gmail.com>
@hank95179 hank95179 force-pushed the fix-issue-4952-zscan branch from d60c10e to 105ae47 Compare December 12, 2025 08:45
@xShinnRyuu
Copy link
Collaborator

Thanks for contributing. I will review the PR and give it a test to see if the fix is appropriate.

@xShinnRyuu
Copy link
Collaborator

@hank95179 Similar to your node fix I believe the better solution is to add a match="value*" to the zscan parameters rather than changing the set it returns.

if not await check_if_server_version_lt(glide_client, "8.0.0"):
            result = await glide_client.zscan(
                key1, initial_cursor, match="value*", no_scores=True // Added match="value*"
            )
            assert result[result_cursor_index] != b"0"
            values_array = cast(List[bytes], result[result_collection_index])
            # Verify that scores are not included
            assert all(
                item.startswith(b"value") and item.isascii() for item in values_array
            )

Please revise.

@xShinnRyuu
Copy link
Collaborator

Hi @hank95179,

This PR has been open with outstanding feedback. If you could address the comments within the next couple of days, that would be great. Otherwise, I’ll plan to take over the PR and address the issue it was intended to resolve.

@xShinnRyuu xShinnRyuu force-pushed the fix-issue-4952-zscan branch from dc6624a to 46a7e4b Compare January 9, 2026 22:20
…ilures

This change increases the timeout from 50s to 120s in TlsCertificateTest.test.ts. This prevents 'Exceeded timeout of 50000 ms for a hook' errors during cluster creation on slower environments, addressing Issue valkey-io#4989.

Signed-off-by: hank95179 <hank95179@gmail.com>
@xShinnRyuu xShinnRyuu force-pushed the fix-issue-4952-zscan branch from 46a7e4b to 39225c0 Compare January 9, 2026 22:21
Copy link
Collaborator

@jamesx-improving jamesx-improving left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Collaborator

@currantw currantw left a comment

Choose a reason for hiding this comment

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

Looks good. ✅

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.

[Python][Flaky Test] TestClusterRoutes > test_zscan & test_sync_zscan

4 participants