mirror of
https://github.com/caddyserver/caddy.git
synced 2025-01-22 09:24:07 +08:00
caddytls: Improve flaky test related to email (#2318)
Signed-off-by: Hiroyuki Sasagawa <hs19870702@gmail.com>
This commit is contained in:
parent
f46da403d8
commit
15455e5a7e
|
@ -179,9 +179,9 @@ func TestGetEmail(t *testing.T) {
|
||||||
// Test3: Get most recent email from before (in storage)
|
// Test3: Get most recent email from before (in storage)
|
||||||
DefaultEmail = ""
|
DefaultEmail = ""
|
||||||
for i, eml := range []string{
|
for i, eml := range []string{
|
||||||
"TEST4-3@foo.com", // test case insensitivity
|
|
||||||
"test4-2@foo.com",
|
|
||||||
"test4-1@foo.com",
|
"test4-1@foo.com",
|
||||||
|
"test4-2@foo.com",
|
||||||
|
"TEST4-3@foo.com", // test case insensitivity
|
||||||
} {
|
} {
|
||||||
u, err := newUser(eml)
|
u, err := newUser(eml)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -197,7 +197,7 @@ func TestGetEmail(t *testing.T) {
|
||||||
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.Hour)) // 1 second isn't always enough space!
|
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…
Reference in New Issue
Block a user