Skip to content

Commit

Permalink
topsql: fix data race in cpuprofile test (pingcap#31450)
Browse files Browse the repository at this point in the history
  • Loading branch information
mornyx authored Jan 7, 2022
1 parent c27f8f6 commit 29d0d01
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions util/cpuprofile/cpuprofile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,12 +213,12 @@ func TestProfileHTTPHandler(t *testing.T) {
router.HandleFunc("/debug/pprof/profile", ProfileHTTPHandler)
httpServer := &http.Server{Handler: router, WriteTimeout: time.Second * 60}
go func() {
if err = httpServer.Serve(listener); err != nil && err != http.ErrServerClosed {
if err := httpServer.Serve(listener); err != nil && err != http.ErrServerClosed {
require.NoError(t, err)
}
}()
defer func() {
err = httpServer.Close()
err := httpServer.Close()
require.NoError(t, err)
}()

Expand Down

0 comments on commit 29d0d01

Please sign in to comment.