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

accounts/keystore: add sleep back for TestUpdatedKeyfileContents #29508

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

darioush
Copy link
Contributor

@darioush darioush commented Apr 11, 2024

Hi. I understand that in #28461 these sleeps were replaced with Chtimes to reduce test execution time.
However, I noticed this test sometimes fails on linux with the race detector enabled, eg:
go test -timeout 900s github.com/ethereum/go-ethereum/accounts/keystore -cover -count=10 -race -shuffle=on

I believe updating the mod time to a past time does not work due to the way the fileCache tracks lastMod:

modified := info.ModTime()
if modified.After(fc.lastMod) {
mods.Add(path)
}
if modified.After(newLastMod) {
newLastMod = modified
}

The sleeps seem preferable to modifying the file cache for testing, or alternatively resetting the lastMod field in the test. Thanks for your consideration.

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

1 participant