Skip to content

Commit f967078

Browse files
tklausergopherbot
authored andcommitted
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 <[email protected]> Reviewed-by: Dmitri Shuralyov <[email protected]> Auto-Submit: Tobias Klauser <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Damien Neil <[email protected]> TryBot-Bypass: Damien Neil <[email protected]>
1 parent 3968a5b commit f967078

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/os/root_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -457,6 +457,9 @@ func TestRootChtimes(t *testing.T) {
457457
case "js", "plan9":
458458
times.atime = times.atime.Truncate(1 * time.Second)
459459
times.mtime = times.mtime.Truncate(1 * time.Second)
460+
case "illumos":
461+
times.atime = times.atime.Truncate(1 * time.Microsecond)
462+
times.mtime = times.mtime.Truncate(1 * time.Microsecond)
460463
}
461464

462465
err := root.Chtimes(test.open, times.atime, times.mtime)

0 commit comments

Comments
 (0)