From: Tobias Klauser Date: Fri, 11 Apr 2025 12:11:37 +0000 (+0200) Subject: os: fix TestRootChtimes on illumos X-Git-Tag: go1.25rc1~490 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=f9670787122a732fb7d81cf64856ab6c50904e17;p=gostls13.git os: fix TestRootChtimes on illumos TestRootChtimes currently fails on illumos [1] because the times returned by os.Stat have only microsecond precision on that builder. Truncate them to make the test pass again. [1] https://build.golang.org/log/9780af24c3b3073dae1d827b2b9f9e3a48912c30 Change-Id: I8cf895d0b60c854c27cb4faf57c3b44bd40bfdd4 Reviewed-on: https://go-review.googlesource.com/c/go/+/664915 Run-TryBot: Tobias Klauser Reviewed-by: Dmitri Shuralyov Auto-Submit: Tobias Klauser LUCI-TryBot-Result: Go LUCI Reviewed-by: Damien Neil TryBot-Bypass: Damien Neil --- diff --git a/src/os/root_test.go b/src/os/root_test.go index bf1b755ad1..3fec9c5684 100644 --- a/src/os/root_test.go +++ b/src/os/root_test.go @@ -457,6 +457,9 @@ func TestRootChtimes(t *testing.T) { case "js", "plan9": times.atime = times.atime.Truncate(1 * time.Second) times.mtime = times.mtime.Truncate(1 * time.Second) + case "illumos": + times.atime = times.atime.Truncate(1 * time.Microsecond) + times.mtime = times.mtime.Truncate(1 * time.Microsecond) } err := root.Chtimes(test.open, times.atime, times.mtime)