Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix flaky test cases in keyspace_test.go #2104

Merged
merged 2 commits into from
Feb 17, 2024

Conversation

git-hulk
Copy link
Member

@git-hulk git-hulk commented Feb 17, 2024

We expired a key with 1 second which is too short for testing the expiration time,
because Metadata::ExpireMsToS function will use rounding to get a closer time value if
METADATA_64BIT_ENCODING_MASK was disabled.

We simply fix this by increasing the expiration time to 2 seconds.

Refer: https://github.com/apache/kvrocks/blob/unstable/src/storage/redis_metadata.cc#L248

This closes #2091

We expired a key with 1 second which is too short for testing the
expiration time, because Metadata::ExpireMsToS function will use
rounding to get a closer time value if METADATA_64BIT_ENCODING_MASK
was enabled.
@PragmaTwice
Copy link
Member

Metadata::ExpireMsToS function will use rounding to get a closer time value if
METADATA_64BIT_ENCODING_MASK was enabled.

I think this function will not be used in the 64bit encoding mode?

@git-hulk
Copy link
Member Author

Metadata::ExpireMsToS function will use rounding to get a closer time value if
METADATA_64BIT_ENCODING_MASK was enabled.

I think this function will not be used in the 64bit encoding mode?

Yes, it's a typo in the comments. Should be disabled instead of the enabled.

Copy link

@git-hulk git-hulk merged commit e8c05a3 into apache:unstable Feb 17, 2024
30 checks passed
JoverZhang pushed a commit to JoverZhang/kvrocks that referenced this pull request Feb 24, 2024
We expired a key with 1 second which is too short for testing the expiration time,
because `Metadata::ExpireMsToS` function will use rounding to get a closer time value if
METADATA_64BIT_ENCODING_MASK was disabled.

This closes apache#2091
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.

[CI] TestKeyspace.Type_a_expired_key failed
3 participants