aboutsummaryrefslogtreecommitdiffstats
path: root/accounts/keystore
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2017-11-24 22:21:39 +0800
committerGitHub <noreply@github.com>2017-11-24 22:21:39 +0800
commit0981d2e566535e1351f7988d3586d2daeae895ec (patch)
treed4d9959ae4a3bbb03a07f541da6531c4af6f32f5 /accounts/keystore
parentf14047dae57aa69e4fa08d57e19ee9c0283dfa54 (diff)
parentb64525694b81d4f278b8d4690d29416844c72349 (diff)
downloaddexon-0981d2e566535e1351f7988d3586d2daeae895ec.tar.gz
dexon-0981d2e566535e1351f7988d3586d2daeae895ec.tar.zst
dexon-0981d2e566535e1351f7988d3586d2daeae895ec.zip
Merge pull request #15498 from nonsense/account_cache_modtime_test_fix
accounts/keystore: change modtime for test case files to be bigger than 1sec.
Diffstat (limited to 'accounts/keystore')
-rw-r--r--accounts/keystore/account_cache_test.go12
1 files changed, 11 insertions, 1 deletions
diff --git a/accounts/keystore/account_cache_test.go b/accounts/keystore/account_cache_test.go
index e3dc31065..fe9233c04 100644
--- a/accounts/keystore/account_cache_test.go
+++ b/accounts/keystore/account_cache_test.go
@@ -59,7 +59,7 @@ func TestWatchNewFile(t *testing.T) {
// Ensure the watcher is started before adding any files.
ks.Accounts()
- time.Sleep(200 * time.Millisecond)
+ time.Sleep(1000 * time.Millisecond)
// Move in the files.
wantAccounts := make([]accounts.Account, len(cachetestAccounts))
@@ -349,6 +349,9 @@ func TestUpdatedKeyfileContents(t *testing.T) {
return
}
+ // needed so that modTime of `file` is different to its current value after forceCopyFile
+ time.Sleep(1000 * time.Millisecond)
+
// Now replace file contents
if err := forceCopyFile(file, cachetestAccounts[1].URL.Path); err != nil {
t.Fatal(err)
@@ -362,6 +365,9 @@ func TestUpdatedKeyfileContents(t *testing.T) {
return
}
+ // needed so that modTime of `file` is different to its current value after forceCopyFile
+ time.Sleep(1000 * time.Millisecond)
+
// Now replace file contents again
if err := forceCopyFile(file, cachetestAccounts[2].URL.Path); err != nil {
t.Fatal(err)
@@ -374,6 +380,10 @@ func TestUpdatedKeyfileContents(t *testing.T) {
t.Error(err)
return
}
+
+ // needed so that modTime of `file` is different to its current value after ioutil.WriteFile
+ time.Sleep(1000 * time.Millisecond)
+
// Now replace file contents with crap
if err := ioutil.WriteFile(file, []byte("foo"), 0644); err != nil {
t.Fatal(err)