Skip to content

Commit

Permalink
fix data race in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
oke11o committed Jan 29, 2024
1 parent 5b4899f commit 916fd46
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ prepare: fmt test vet

test:
@echo "$(OK_COLOR)Test packages$(NO_COLOR)"
@go test -v ./...
go test -race -v ./...

coverage:
@echo "$(OK_COLOR)Make coverage report$(NO_COLOR)"
Expand Down
2 changes: 0 additions & 2 deletions tests/acceptance/http_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,9 @@ func (s *PandoraSuite) Test_Http_Check_Passes() {
s.Run(tt.name, func() {
var requetsCount atomic.Int64 // Request served by test server.
requetsCount.Store(0)
var reqs []string
srv := httptest.NewUnstartedServer(http.HandlerFunc(
func(rw http.ResponseWriter, req *http.Request) {
requetsCount.Inc()
reqs = append(reqs, req.URL.String())
rw.WriteHeader(http.StatusOK)
}))
defer srv.Close()
Expand Down

0 comments on commit 916fd46

Please sign in to comment.