Skip to content

[IO-279] Fix macos-x-13-java8 unstable test due to posix file time#760

Merged
garydgregory merged 1 commit into
apache:masterfrom
JoergBudi:bugfix/fix-unstable-tailertest
Jul 6, 2025
Merged

[IO-279] Fix macos-x-13-java8 unstable test due to posix file time#760
garydgregory merged 1 commit into
apache:masterfrom
JoergBudi:bugfix/fix-unstable-tailertest

Conversation

@JoergBudi

Copy link
Copy Markdown
Contributor

… resolution is only 1s. Adding TestUtils.sleepTillNextFullSecond()

@garydgregory
followup to PR #757 . The test was unstable, as the java.nio.file.Files.getLastModifiedTime() on macosx-13-java8 only has a time resolution of 1s (and it is used in Tailer.TailablePath.lastModifiedFIleTIme).

Note: it seems, that java.io.File.lastModified() has millisecond resolution on that platform, but it doesn't make sense to change the real code for everyone because of an odd platform.

So tests are now adapated, that the file date is updated after the curent second has passed to comply with posix standard Additionaly the waittime is shortened a little by polling instead of waiting max time.

see https://github.com/JoergBudi/commons-io/actions/runs/16092357707/job/45410764092 for passed test.

… resolution is only 1s. Adding TestUtils.sleepTillNextFullSecond()
@garydgregory garydgregory merged commit a3e33e1 into apache:master Jul 6, 2025
18 of 21 checks passed
@garydgregory garydgregory changed the title [io-279] fixing macos-x-13-java8 unstable test due to posix file time… [IO-279] Fix macos-x-13-java8 unstable test due to posix file time Jul 6, 2025
@garydgregory

Copy link
Copy Markdown
Member

@JoergBudi

Thank you for the follow-up PR 👍

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