go-ethereum/accounts/keystore
Daniel Liu 7d463aedd3
accounts/keystore: fix flaky TestUpdatedKeyfileContents (#34084)
TestUpdatedKeyfileContents was intermittently failing with:

- Emptying account file failed
- wasn't notified of new accounts

Root cause: waitForAccounts required the account list match and an
immediately readable ks.changes notification in the same instant,
creating a timing race between cache update visibility and channel
delivery.

This change keeps the same timeout window but waits until both
conditions are observed, which preserves test intent while removing the
flaky timing dependency.

Validation:
- go test ./accounts/keystore -run '^TestUpdatedKeyfileContents$'
-count=100
2026-04-13 14:10:56 +02:00
..
testdata
account_cache.go
account_cache_test.go
file_cache.go
key.go
keystore.go
keystore_fuzzing_test.go
keystore_test.go
passphrase.go
passphrase_test.go
plain.go
plain_test.go
presale.go
wallet.go
watch.go
watch_fallback.go