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

api: ensure API times used for trigger comparisons #5509

Merged
merged 2 commits into from
Feb 16, 2022

Conversation

milas
Copy link
Contributor

@milas milas commented Feb 16, 2022

The trigger package now returns metav1.MicroTime instead of
stdlib time.Time for trigger (start/restart/stop) timestamps.

There's a ripple effect for some internal state types on reconcilers
which went through the same conversion.

Comparisons are also all now made via the timecmp package using
the API types.

Primarily, this fixes flakiness for tests on Windows; it's fairly
unlikely that the cases here would cause unexpected behavior at
runtime because real world events (e.g. clicking a button) are not
performed instantaneously.

Testing

Previously, I'd pretty consistently see failures with just a few (~10) test runs for TestCancelButton (in internal/engine) on a Windows 11 machine.

After these changes, 500 runs passes:

PS C:\Users\User\tilt> go test ./internal/engine -run '^TestCancelButton$' -failfast -count 500
ok      github.com/tilt-dev/tilt/internal/engine        98.211s

The `trigger` package now returns `metav1.MicroTime` instead of
stdlib `time.Time` for trigger (start/restart/stop) timestamps.

There's a ripple effect for some internal state types on reconcilers
which went through the same conversion.

Comparisons are also all now made via the `timecmp` package using
the API types.

Primarily, this fixes flakiness for tests on Windows; it's fairly
unlikely that the cases here would cause unexpected behavior at
runtime because real world events (e.g. clicking a button) are not
performed instantaneously.
@milas milas requested a review from landism February 16, 2022 18:58
Because `!timecmp.BeforeOrEqual` is confusing as heck
Copy link
Member

@landism landism left a comment

Choose a reason for hiding this comment

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

Thanks!

@milas milas merged commit 485b16b into master Feb 16, 2022
@milas milas deleted the milas/flaky-win-cancel branch February 16, 2022 21:50
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