mirror of
https://github.com/caddyserver/caddy.git
synced 2025-01-20 22:52:58 -05:00
tls: Improve flaky test depending on CPU scheduling (I think)
This commit is contained in:
parent
36f8759a7b
commit
80eb45fcfb
1 changed files with 2 additions and 2 deletions
|
@ -166,12 +166,12 @@ func TestGetEmail(t *testing.T) {
|
||||||
t.Fatalf("Error saving user %d: %v", i, err)
|
t.Fatalf("Error saving user %d: %v", i, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Change modified time so they're all different, so the test becomes deterministic
|
// Change modified time so they're all different and the test becomes more deterministic
|
||||||
f, err := os.Stat(testStorage.user(eml))
|
f, err := os.Stat(testStorage.user(eml))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("Could not access user folder for '%s': %v", eml, err)
|
t.Fatalf("Could not access user folder for '%s': %v", eml, err)
|
||||||
}
|
}
|
||||||
chTime := f.ModTime().Add(-(time.Duration(i) * time.Second))
|
chTime := f.ModTime().Add(-(time.Duration(i) * time.Hour)) // 1 second isn't always enough space!
|
||||||
if err := os.Chtimes(testStorage.user(eml), chTime, chTime); err != nil {
|
if err := os.Chtimes(testStorage.user(eml), chTime, chTime); err != nil {
|
||||||
t.Fatalf("Could not change user folder mod time for '%s': %v", eml, err)
|
t.Fatalf("Could not change user folder mod time for '%s': %v", eml, err)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue