修复go test报错

This commit is contained in:
bjdgy 2024-01-31 22:47:54 +08:00
parent 2fc3c33880
commit 7554876259
6 changed files with 8 additions and 3 deletions
.github/workflows
docker
index_template
server

View File

@ -40,6 +40,7 @@ jobs:
- name: Test coverage - name: Test coverage
run: | run: |
cd server cd server
go test ./...
go test -race -coverprofile=coverage.txt -covermode=atomic -v ./... go test -race -coverprofile=coverage.txt -covermode=atomic -v ./...
- name: Upload coverage reports to Codecov - name: Upload coverage reports to Codecov

View File

@ -39,7 +39,7 @@ COPY docker/init_release.sh /tmp/
COPY --from=builder_golang /server/anylink /app/ COPY --from=builder_golang /server/anylink /app/
COPY docker/docker_entrypoint.sh server/bridge-init.sh ./README.md ./LICENSE /app/ COPY docker/docker_entrypoint.sh server/bridge-init.sh ./README.md ./LICENSE /app/
COPY ./deploy /app/deploy COPY ./deploy /app/deploy
COPY ./home /app/home COPY ./index_template /app/index_template
COPY ./server/conf /app/conf COPY ./server/conf /app/conf
#TODO 本地打包时使用镜像 #TODO 本地打包时使用镜像

View File

@ -73,6 +73,7 @@ mtu = 1460
default_domain = "example.com" default_domain = "example.com"
#default_domain = "example.com abc.example.com" #default_domain = "example.com abc.example.com"
#空闲链接超时时间(秒)-超时后断开链接0关闭此功能
idle_timeout = 7200 idle_timeout = 7200
#session过期时间用于断线重连0永不过期 #session过期时间用于断线重连0永不过期
session_timeout = 3600 session_timeout = 3600

View File

@ -50,7 +50,7 @@ func startTls() {
MinVersion: tls.VersionTLS12, MinVersion: tls.VersionTLS12,
CipherSuites: selectedCipherSuites, CipherSuites: selectedCipherSuites,
GetCertificate: func(chi *tls.ClientHelloInfo) (*tls.Certificate, error) { GetCertificate: func(chi *tls.ClientHelloInfo) (*tls.Certificate, error) {
base.Trace("GetCertificate", chi.ServerName) base.Trace("GetCertificate ServerName", chi.ServerName)
return dbdata.GetCertificateBySNI(chi.ServerName) return dbdata.GetCertificateBySNI(chi.ServerName)
}, },
} }

View File

@ -33,7 +33,7 @@ func TestConnSession(t *testing.T) {
sess.MacAddr = "00:15:5d:50:14:43" sess.MacAddr = "00:15:5d:50:14:43"
cSess := sess.NewConn() cSess := sess.NewConn()
base.Info("cSess", cSess) // base.Info("cSess", cSess)
err := cSess.RateLimit(100, true) err := cSess.RateLimit(100, true)
ast.Nil(err) ast.Nil(err)
@ -60,4 +60,7 @@ func TestConnSession(t *testing.T) {
ast.Equal(cmpName, "") ast.Equal(cmpName, "")
cSess.Close() cSess.Close()
// 等待日志执行完成
time.Sleep(time.Second * 10)
} }