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 modification time check in integration tests #1875

Merged
merged 2 commits into from
May 2, 2024

Conversation

ashmeenkaur
Copy link
Collaborator

@ashmeenkaur ashmeenkaur commented Apr 29, 2024

Description

This PR fixes flaky file and directory attributes tests.

Cause: The tests were flaky because kernel clock can be out of sync of time.Now() Ref: golang/go#33510
To handle this case, we were rounding off the times to nearest second for comparison but sometimes, edge condition can happen where pre-create time gets rounded up while the actual modification time gets rounded down.

New Fix: We will use time slop of 25 milli seconds to move pre and post create times so that file modification time lies between the range of preCreate and postCreate time.

Link to the issue in case of a bug fix.

NA

Testing details

  1. Manual - NA
  2. Unit tests - NA
  3. Integration tests - Ran on VM and via KOKORO

@ashmeenkaur ashmeenkaur added the execute-integration-tests Run only integration tests label Apr 29, 2024
@ashmeenkaur ashmeenkaur marked this pull request as ready for review April 29, 2024 10:36
@ashmeenkaur ashmeenkaur requested a review from a team as a code owner April 29, 2024 10:36
@ashmeenkaur ashmeenkaur changed the title fix flaky modification time check tests fix flaky modification time check in integration tests Apr 29, 2024
@ashmeenkaur ashmeenkaur requested review from raj-prince and removed request for sethiay May 2, 2024 09:36
@ashmeenkaur ashmeenkaur merged commit 485cd8d into master May 2, 2024
8 checks passed
@ashmeenkaur ashmeenkaur deleted the fix-flaky-attributes-test branch May 2, 2024 10:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
execute-integration-tests Run only integration tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants