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

Attempt to make filesystem tests less flaky #1181

Merged
merged 2 commits into from Jan 3, 2023

Conversation

swankjesse
Copy link
Member

I've been observing failures like this:

expected 2022-12-31T16:00:40.999Z in 2022-12-31T16:00:41Z..2022-12-31T16:00:43Z (relaxed from 2022-12-31T16:00:41.002314Z..2022-12-31T16:00:41.002365Z)

Copy link
Collaborator

@yschimke yschimke left a comment

Choose a reason for hiding this comment

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

Seems relatively safe.

* https://docs.microsoft.com/en-us/windows/win32/sysinfo/file-times
*/
private fun Instant.maxFileSystemTime(): Instant {
return Instant.fromEpochSeconds(plus(2.seconds).epochSeconds)
val paddedInstant = plus(200.milliseconds)
return Instant.fromEpochSeconds(paddedInstant.plus(2.seconds).epochSeconds)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why go via epoch seconds?

Copy link
Member Author

Choose a reason for hiding this comment

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

It’s attempting to drop precision, consistent with what FAT32 and friends do.

I've been observing failures like this:

    expected 2022-12-31T16:00:40.999Z in 2022-12-31T16:00:41Z..2022-12-31T16:00:43Z (relaxed from 2022-12-31T16:00:41.002314Z..2022-12-31T16:00:41.002365Z)
@swankjesse swankjesse force-pushed the jwilson.1231.less_flaky_clocks branch from 61c906a to 06f689e Compare January 3, 2023 14:58
@swankjesse swankjesse merged commit ae07130 into master Jan 3, 2023
@swankjesse swankjesse deleted the jwilson.1231.less_flaky_clocks branch January 3, 2023 16:37
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.

None yet

2 participants