Skip to content

Commit

Permalink
修复go test报错
Browse files Browse the repository at this point in the history
  • Loading branch information
bjdgy committed Jan 31, 2024
1 parent 2fc3c33 commit 7554876
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ jobs:
- name: Test coverage
run: |
cd server
go test ./...
go test -race -coverprofile=coverage.txt -covermode=atomic -v ./...
- name: Upload coverage reports to Codecov
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ COPY docker/init_release.sh /tmp/
COPY --from=builder_golang /server/anylink /app/
COPY docker/docker_entrypoint.sh server/bridge-init.sh ./README.md ./LICENSE /app/
COPY ./deploy /app/deploy
COPY ./home /app/home
COPY ./index_template /app/index_template
COPY ./server/conf /app/conf

#TODO 本地打包时使用镜像
Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions server/conf/server-sample.toml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ mtu = 1460
default_domain = "example.com"
#default_domain = "example.com abc.example.com"

#空闲链接超时时间(秒)-超时后断开链接,0关闭此功能
idle_timeout = 7200
#session过期时间,用于断线重连,0永不过期
session_timeout = 3600
Expand Down
2 changes: 1 addition & 1 deletion server/handler/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func startTls() {
MinVersion: tls.VersionTLS12,
CipherSuites: selectedCipherSuites,
GetCertificate: func(chi *tls.ClientHelloInfo) (*tls.Certificate, error) {
base.Trace("GetCertificate", chi.ServerName)
base.Trace("GetCertificate ServerName", chi.ServerName)
return dbdata.GetCertificateBySNI(chi.ServerName)
},
}
Expand Down
5 changes: 4 additions & 1 deletion server/sessdata/session_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func TestConnSession(t *testing.T) {
sess.MacAddr = "00:15:5d:50:14:43"

cSess := sess.NewConn()
base.Info("cSess", cSess)
// base.Info("cSess", cSess)

err := cSess.RateLimit(100, true)
ast.Nil(err)
Expand All @@ -60,4 +60,7 @@ func TestConnSession(t *testing.T) {
ast.Equal(cmpName, "")

cSess.Close()

// 等待日志执行完成
time.Sleep(time.Second * 10)
}

0 comments on commit 7554876

Please sign in to comment.