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

Use the same source of time in flaky test #3009

Merged
merged 2 commits into from
Dec 17, 2024
Merged

Conversation

eapolinario
Copy link
Collaborator

Why are the changes needed?

test_get_container_error_timestamp has been failing semi-consistently only on Windows. We all hate flaky tests.

What changes were proposed in this pull request?

The test relies on the function get_container_error_timestamp which returns a protobuf Timestamp object, which uses time.time to collect the current time. However, the granularity of time.time and datetime.now are different (the latter being more precise as per https://docs.python.org/3/library/datetime.html#datetime.datetime.now).

How was this patch tested?

I don't have a Windows machine, but tests run fine locally. Will kick off a few runs in CI just to confirm.

Setup process

Screenshots

Check all the applicable boxes

  • I updated the documentation accordingly.
  • All new and existing tests passed.
  • All commits are signed-off.

Related PRs

Docs link

Signed-off-by: Eduardo Apolinario <eapolinario@users.noreply.github.com>
Signed-off-by: Eduardo Apolinario <eapolinario@users.noreply.github.com>
@eapolinario eapolinario merged commit 34af2e2 into master Dec 17, 2024
102 checks passed
shuyingliang pushed a commit to shuyingliang/flytekit that referenced this pull request Dec 20, 2024
* Use the same source of time in flaky test

Signed-off-by: Eduardo Apolinario <eapolinario@users.noreply.github.com>

* Use proto Timestamp to get current time

Signed-off-by: Eduardo Apolinario <eapolinario@users.noreply.github.com>

---------

Signed-off-by: Eduardo Apolinario <eapolinario@users.noreply.github.com>
Co-authored-by: Eduardo Apolinario <eapolinario@users.noreply.github.com>
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