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

os: TestChtimes failures [1.23 backport] #68812

Closed
gopherbot opened this issue Aug 9, 2024 · 3 comments
Closed

os: TestChtimes failures [1.23 backport] #68812

gopherbot opened this issue Aug 9, 2024 · 3 comments
Labels
CherryPickApproved Used during the release process for point releases Testing An issue that has been verified to require only test changes, not just a test failure.
Milestone

Comments

@gopherbot
Copy link
Contributor

@dmitshur requested issue #68687 to be considered for backport to the next 1.23 minor release.

@gopherbot Please backport to Go 1.23 and 1.22. This is a test-only fix that makes a test more resilient against other programs possibly reading files in the background. It's also needed to fix test flakiness on the linux/arm builder where this started happening after a builder environment change.

@gopherbot gopherbot added CherryPickCandidate Used during the release process for point releases Testing An issue that has been verified to require only test changes, not just a test failure. labels Aug 9, 2024
@gopherbot gopherbot added this to the Go1.23.1 milestone Aug 9, 2024
@gopherbot
Copy link
Contributor Author

Change https://go.dev/cl/604196 mentions this issue: [release-branch.go1.23] os: fix Chtimes test flakes

@cagedmantis
Copy link
Contributor

This has been approved as it is a test only fix.

@cagedmantis cagedmantis added the CherryPickApproved Used during the release process for point releases label Aug 14, 2024
@gopherbot gopherbot removed the CherryPickCandidate Used during the release process for point releases label Aug 14, 2024
gopherbot pushed a commit that referenced this issue Aug 14, 2024
It appears that some builders (notably, linux-arm) have some additional
security software installed, which apparently reads the files created by
tests. As a result, test file atime is changed, making the test fail
like these:

=== RUN   TestChtimesOmit
    ...
    os_test.go:1475: atime mismatch, got: "2024-07-30 18:42:03.450932494 +0000 UTC", want: "2024-07-30 18:42:02.450932494 +0000 UTC"

=== RUN   TestChtimes
    ...
    os_test.go:1539: AccessTime didn't go backwards; was=2024-07-31 20:45:53.390326147 +0000 UTC, after=2024-07-31 20:45:53.394326118 +0000 UTC

According to inode(7), atime is changed when more than 0 bytes are read
from the file. So, one possible solution to these flakes is to make the
test files empty, so no one can read more than 0 bytes from them.

For #68687
For #68663
Fixes #68812

Change-Id: Ib9234567883ef7b16ff8811e3360cd26c2d6bdab
Reviewed-on: https://go-review.googlesource.com/c/go/+/604315
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Kirill Kolyshkin <kolyshkin@gmail.com>
Reviewed-by: Robert Griesemer <gri@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Commit-Queue: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
(cherry picked from commit 84266e1)
Reviewed-on: https://go-review.googlesource.com/c/go/+/604196
@gopherbot
Copy link
Contributor Author

Closed by merging CL 604196 (commit dbecb41) to release-branch.go1.23.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CherryPickApproved Used during the release process for point releases Testing An issue that has been verified to require only test changes, not just a test failure.
Projects
None yet
Development

No branches or pull requests

2 participants