Skip to content

Commit

Permalink
Update Unit Test
Browse files Browse the repository at this point in the history
  • Loading branch information
Allenxuxu committed Dec 3, 2022
1 parent 2c4dd99 commit 7faaba8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ jobs:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.16
uses: actions/setup-go@v1
- name: Set up Go 1.18
uses: actions/setup-go@v3
with:
go-version: 1.16
go-version: 1.18
id: go
- name: Go version
run: go version
- name: Code
uses: actions/checkout@v1
uses: actions/checkout@v3
- name: Intsall Golangci-lint
run: curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s -- -b . latest
- name: Lint
Expand All @@ -27,15 +27,15 @@ jobs:
matrix:
os: [macOS-latest,ubuntu-latest,windows-latest]
steps:
- name: Set up Go 1.16
uses: actions/setup-go@v1
- name: Set up Go 1.18
uses: actions/setup-go@v3
with:
go-version: 1.16
go-version: 1.18
id: go
- name: Go version
run: go version
- name: Code
uses: actions/checkout@v1
uses: actions/checkout@v3
- name: Go Get dependencies
run: go get -v -t -d ./...
- name: Go Test
Expand Down
4 changes: 2 additions & 2 deletions server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ func TestServer_Stop(t *testing.T) {
wg := &sync.WaitGroupWrapper{}
for i := 0; i < 100; i++ {
wg.AddAndRun(func() {
conn, err := net.DialTimeout("tcp", "127.0.0.1:1832", time.Second*60)
conn, err := net.DialTimeout("tcp", "127.0.0.1:1832", time.Second*1)
if err != nil {
failed.Add(1)
log.Error(err)
Expand All @@ -186,7 +186,7 @@ func TestServer_Stop(t *testing.T) {
wg.Wait()
log.Infof("Success: %d Failed: %d\n", success, failed)

time.Sleep(time.Second)
time.Sleep(time.Second * 2)
count := handler.Count.Get()
if count != 0 {
t.Fatal(count)
Expand Down

0 comments on commit 7faaba8

Please sign in to comment.