mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 02:42:27 +00:00
accounts/keystore: add sleep back for TestUpdatedKeyfileContents
This commit is contained in:
parent
34aac1d756
commit
575b02a931
1 changed files with 6 additions and 6 deletions
|
|
@ -352,8 +352,8 @@ func TestUpdatedKeyfileContents(t *testing.T) {
|
||||||
t.Error(err)
|
t.Error(err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
// needed so that modTime of `file` is different to its current value after forceCopyFile
|
// needed so that modTime of `file` will be greater than its current value after forceCopyFile
|
||||||
os.Chtimes(file, time.Now().Add(-time.Second), time.Now().Add(-time.Second))
|
time.Sleep(time.Second)
|
||||||
|
|
||||||
// Now replace file contents
|
// Now replace file contents
|
||||||
if err := forceCopyFile(file, cachetestAccounts[1].URL.Path); err != nil {
|
if err := forceCopyFile(file, cachetestAccounts[1].URL.Path); err != nil {
|
||||||
|
|
@ -368,8 +368,8 @@ func TestUpdatedKeyfileContents(t *testing.T) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// needed so that modTime of `file` is different to its current value after forceCopyFile
|
// needed so that modTime of `file` will be greater than its current value after forceCopyFile
|
||||||
os.Chtimes(file, time.Now().Add(-time.Second), time.Now().Add(-time.Second))
|
time.Sleep(time.Second)
|
||||||
|
|
||||||
// Now replace file contents again
|
// Now replace file contents again
|
||||||
if err := forceCopyFile(file, cachetestAccounts[2].URL.Path); err != nil {
|
if err := forceCopyFile(file, cachetestAccounts[2].URL.Path); err != nil {
|
||||||
|
|
@ -384,8 +384,8 @@ func TestUpdatedKeyfileContents(t *testing.T) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// needed so that modTime of `file` is different to its current value after os.WriteFile
|
// needed so that modTime of `file` will be greater than its current value after os.WriteFile
|
||||||
os.Chtimes(file, time.Now().Add(-time.Second), time.Now().Add(-time.Second))
|
time.Sleep(time.Second)
|
||||||
|
|
||||||
// Now replace file contents with crap
|
// Now replace file contents with crap
|
||||||
if err := os.WriteFile(file, []byte("foo"), 0600); err != nil {
|
if err := os.WriteFile(file, []byte("foo"), 0600); err != nil {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue