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 HEXPIRE test case failure in pipeline #949

Merged
merged 3 commits into from
Jan 24, 2025

Conversation

Vijay-Nirmal
Copy link
Contributor

I am not sure about the cause of the failure as the test runtime is not more than 1 sec to trigger this issue. Increased the expiration time to avoid the possibility of it getting expired.

fix #948

@badrishc
Copy link
Contributor

I am not sure about the cause of the failure as the test runtime is not more than 1 sec to trigger this issue. Increased the expiration time to avoid the possibility of it getting expired.

fix #948

Did you see the failure log to verify the failed test did not take more than a second? Then we need to diagnose this further as this fix isn't the culprit

@Vijay-Nirmal
Copy link
Contributor Author

Vijay-Nirmal commented Jan 24, 2025

@badrishc Yes, I have mentioned the same thing in the attached issue. At the time of raising this PR, it was just a quick fix to unblock the pipeline, also I was pretty confident that it's not an issue from the actual expiration logic.

Now I have diagnosed this issue further. The issue is with the code in the test file only. The culprit is the DateTimeOffset.UtcNow.AddSeconds(1).ToUnixTimeSeconds().ToString() line in unit testing. This line can return a time that is less than 1 sec from the current time, even it can be almost the same as the current time. Below is an example of when that can happen.

Current Time: 01:01:00.9980000
Current Time + 1 sec: 01:01:01.9980000
Current Time + 1 sec as Seconds: 01:01:01 (assume this timestamp as seconds, this value is almost the same as current time)

This happens because ToUnixTimeSeconds method counts the number of full seconds in the provided time, basically it works like Math.Floor for seconds.

Provided the above reason, I can say the fix provided in the PR is good enough to solve this issue with unit-testing code

@TalZaccai TalZaccai merged commit 85f49d9 into microsoft:main Jan 24, 2025
15 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.

Pipeline failing on HEXPIREAT Test
3 participants