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 cmd/geth: remove unlock commandline flag (#30737) 2024-11-15 10:15:15 +01:00
account_cache.go cmd/geth: remove unlock commandline flag (#30737) 2024-11-15 10:15:15 +01:00
account_cache_test.go accounts/keystore: fix flaky TestUpdatedKeyfileContents (#34084) 2026-04-13 14:10:56 +02:00
file_cache.go all: use github.com/deckarep/golang-set/v2 (generic set) (#26159) 2022-11-14 15:16:52 +01:00
key.go all: replace uses of ioutil with io and os (#24869) 2022-05-16 11:59:35 +02:00
keystore.go accounts/keystore: clear decrypted key after use (#33090) 2025-11-13 16:17:54 +08:00
keystore_fuzzing_test.go tests/fuzzers: move fuzzers into native packages (#28467) 2023-11-14 14:34:29 +01:00
keystore_test.go accounts/keystore: fix typos in comments (#29336) 2024-03-27 13:16:29 +01:00
passphrase.go accounts/keystore: update links to documenation (#32194) 2025-07-14 09:15:18 +02:00
passphrase_test.go accounts: run tests in parallel (#28544) 2023-12-04 14:55:06 +01:00
plain.go accounts/keystore: delete the redundant keystore in filename (#17930) 2018-11-29 12:04:56 +02:00
plain_test.go accounts: run tests in parallel (#28544) 2023-12-04 14:55:06 +01:00
presale.go accounts/keystore: fix panic in decryptPreSaleKey (#33602) 2026-01-14 11:51:48 +01:00
wallet.go accounts/keystore: add missing function doc for SignText (#21914) 2020-11-30 09:03:24 +01:00
watch.go accounts, cmd: fix typos (#28526) 2023-11-20 08:44:05 +01:00
watch_fallback.go accounts/keystore: faster tests (#25827) 2022-10-12 10:53:01 +02:00