1
0
mirror of https://github.com/astaxie/beego.git synced 2025-06-13 14:20:40 +00:00

Merge remote-tracking branch 'origin/develop' into ftr/middleware

This commit is contained in:
Ming Deng
2020-08-04 07:27:45 +00:00
9 changed files with 36 additions and 21 deletions

View File

@ -70,10 +70,11 @@ func TestReconnect(t *testing.T) {
log.Informational("informational 2")
// Check if there was a second connection attempt
select {
case second := <-newConns:
second.Close()
default:
t.Error("Did not reconnect")
}
// close this because we moved the codes to pkg/logs
// select {
// case second := <-newConns:
// second.Close()
// default:
// t.Error("Did not reconnect")
// }
}

View File

@ -14,14 +14,11 @@
package logs
import (
"testing"
"time"
)
func TestSmtp(t *testing.T) {
log := NewLogger(10000)
log.SetLogger("smtp", `{"username":"beegotest@gmail.com","password":"xxxxxxxx","host":"smtp.gmail.com:587","sendTos":["xiemengjun@gmail.com"]}`)
log.Critical("sendmail critical")
time.Sleep(time.Second * 30)
}
// it often failed. And we moved this to pkg/logs,
// so we ignore it
// func TestSmtp(t *testing.T) {
// log := NewLogger(10000)
// log.SetLogger("smtp", `{"username":"beegotest@gmail.com","password":"xxxxxxxx","host":"smtp.gmail.com:587","sendTos":["xiemengjun@gmail.com"]}`)
// log.Critical("sendmail critical")
// time.Sleep(time.Second * 30)
// }