Skip to content

Commit 7faaba8

Browse files
committed
Update Unit Test
1 parent 2c4dd99 commit 7faaba8

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

.github/workflows/go.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ jobs:
55
name: Lint
66
runs-on: ubuntu-latest
77
steps:
8-
- name: Set up Go 1.16
9-
uses: actions/setup-go@v1
8+
- name: Set up Go 1.18
9+
uses: actions/setup-go@v3
1010
with:
11-
go-version: 1.16
11+
go-version: 1.18
1212
id: go
1313
- name: Go version
1414
run: go version
1515
- name: Code
16-
uses: actions/checkout@v1
16+
uses: actions/checkout@v3
1717
- name: Intsall Golangci-lint
1818
run: curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s -- -b . latest
1919
- name: Lint
@@ -27,15 +27,15 @@ jobs:
2727
matrix:
2828
os: [macOS-latest,ubuntu-latest,windows-latest]
2929
steps:
30-
- name: Set up Go 1.16
31-
uses: actions/setup-go@v1
30+
- name: Set up Go 1.18
31+
uses: actions/setup-go@v3
3232
with:
33-
go-version: 1.16
33+
go-version: 1.18
3434
id: go
3535
- name: Go version
3636
run: go version
3737
- name: Code
38-
uses: actions/checkout@v1
38+
uses: actions/checkout@v3
3939
- name: Go Get dependencies
4040
run: go get -v -t -d ./...
4141
- name: Go Test

server_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ func TestServer_Stop(t *testing.T) {
170170
wg := &sync.WaitGroupWrapper{}
171171
for i := 0; i < 100; i++ {
172172
wg.AddAndRun(func() {
173-
conn, err := net.DialTimeout("tcp", "127.0.0.1:1832", time.Second*60)
173+
conn, err := net.DialTimeout("tcp", "127.0.0.1:1832", time.Second*1)
174174
if err != nil {
175175
failed.Add(1)
176176
log.Error(err)
@@ -186,7 +186,7 @@ func TestServer_Stop(t *testing.T) {
186186
wg.Wait()
187187
log.Infof("Success: %d Failed: %d\n", success, failed)
188188

189-
time.Sleep(time.Second)
189+
time.Sleep(time.Second * 2)
190190
count := handler.Count.Get()
191191
if count != 0 {
192192
t.Fatal(count)

0 commit comments

Comments
 (0)