Skip to content

Commit

Permalink
Fix race in ExportStatusWriter
Browse files Browse the repository at this point in the history
  • Loading branch information
anacrolix committed Jan 19, 2024
1 parent 192f4e8 commit 3cc8774
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions internal/testutil/status_writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ func ExportStatusWriter(sw StatusWriter, path string, t testing.TB) (release fun
http.HandleFunc(
pattern,
func(w http.ResponseWriter, r *http.Request) {
mu.Lock()
sw := sws[pattern]
mu.Unlock()
if sw == nil {
http.NotFound(w, r)
return
Expand Down

0 comments on commit 3cc8774

Please sign in to comment.