Skip to content

Commit

Permalink
Make the tests complete earlier. (#1848)
Browse files Browse the repository at this point in the history
Reduce the test duration to 36% of the original time.
  • Loading branch information
newacorn authored Aug 31, 2024
1 parent b0ea03f commit c15489d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3836,13 +3836,14 @@ func TestShutdownCloseIdleConns(t *testing.T) {
}

func TestShutdownWithContext(t *testing.T) {
t.Parallel()
done := make(chan struct{})
defer close(done)
ln := fasthttputil.NewInmemoryListener()
s := &Server{
Handler: func(ctx *RequestCtx) {
time.Sleep(4 * time.Second)
<-done
ctx.Success("aaa/bbb", []byte("real response"))
close(done)
},
}
go func() {
Expand Down Expand Up @@ -3885,7 +3886,6 @@ func TestShutdownWithContext(t *testing.T) {
if o := atomic.LoadInt32(&s.open); o != 1 {
t.Fatalf("unexpected open connection num: %#v. Expecting %#v", o, 1)
}
<-done
}

func TestMultipleServe(t *testing.T) {
Expand Down

0 comments on commit c15489d

Please sign in to comment.