From 0a508133d5e1f468bc378a600f9cb3ca0c663268 Mon Sep 17 00:00:00 2001 From: Chris Date: Wed, 18 Oct 2017 14:13:14 -0700 Subject: fix email race condition (#7656) --- api/apitestlib.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'api/apitestlib.go') diff --git a/api/apitestlib.go b/api/apitestlib.go index 58e2a5965..4c4773318 100644 --- a/api/apitestlib.go +++ b/api/apitestlib.go @@ -196,7 +196,7 @@ func (me *TestHelper) CreateUser(client *model.Client) *model.User { id := model.NewId() user := &model.User{ - Email: "success+" + id + "@simulator.amazonses.com", + Email: GenerateTestEmail(), Username: "un_" + id, Nickname: "nn_" + id, Password: "Password1", @@ -360,7 +360,10 @@ func (me *TestHelper) LoginSystemAdmin() { } func GenerateTestEmail() string { - return strings.ToLower("success+" + model.NewId() + "@simulator.amazonses.com") + if utils.Cfg.EmailSettings.SMTPServer != "dockerhost" { + return strings.ToLower("success+" + model.NewId() + "@simulator.amazonses.com") + } + return strings.ToLower(model.NewId() + "@dockerhost") } func GenerateTestTeamName() string { -- cgit v1.2.3-1-g7c22