0
Fork 0
mirror of https://github.com/caddyserver/caddy.git synced 2025-01-06 22:40:31 -05:00

caddytls: Improve flaky test related to email (#2318)

Signed-off-by: Hiroyuki Sasagawa <hs19870702@gmail.com>
This commit is contained in:
16yuki0702 2018-10-31 02:59:23 +09:00 committed by Matt Holt
parent f46da403d8
commit 15455e5a7e

View file

@ -179,9 +179,9 @@ func TestGetEmail(t *testing.T) {
// Test3: Get most recent email from before (in storage)
DefaultEmail = ""
for i, eml := range []string{
"TEST4-3@foo.com", // test case insensitivity
"test4-2@foo.com",
"test4-1@foo.com",
"test4-2@foo.com",
"TEST4-3@foo.com", // test case insensitivity
} {
u, err := newUser(eml)
if err != nil {
@ -197,7 +197,7 @@ func TestGetEmail(t *testing.T) {
if err != nil {
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 {
t.Fatalf("Could not change user folder mod time for '%s': %v", eml, err)
}