We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I get a WARNING: DATA RACE when running parallel tests with the "-race" flag in RequestLoggerConfig.
WARNING: DATA RACE
RequestLoggerConfig
No data race in parallel tests
Data race in parallel tests
Save code below to bug_test.go:
bug_test.go
package bug import ( "net/http" "net/http/httptest" "testing" "github.com/labstack/echo/v4" "github.com/labstack/echo/v4/middleware" ) func New() *echo.Echo { e := echo.New() e.Pre( middleware.RequestLoggerWithConfig( middleware.RequestLoggerConfig{}, // just example ), ) return e } func TestB(t *testing.T) { t.Parallel() req := httptest.NewRequest(http.MethodGet, "/", nil) res := httptest.NewRecorder() New().ServeHTTP(res, req) } func TestA(t *testing.T) { t.Parallel() req := httptest.NewRequest(http.MethodGet, "/", nil) res := httptest.NewRecorder() New().ServeHTTP(res, req) }
Run: go test -race bug_test.go.
go test -race bug_test.go
See "Steps to reproduce".
v4.10.2
RequestLoggerConfig override global now which defined in rate_limiter.go without sync. I think this operation must be safe.
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
Issue Description
I get a
WARNING: DATA RACE
when running parallel tests with the "-race" flag inRequestLoggerConfig
.Checklist
Expected behaviour
No data race in parallel tests
Actual behaviour
Data race in parallel tests
Steps to reproduce
Save code below to
bug_test.go
:Run:
go test -race bug_test.go
.Working code to debug
See "Steps to reproduce".
Version/commit
v4.10.2
Reason/Solution
RequestLoggerConfig
override global now which defined in rate_limiter.go without sync. I think this operation must be safe.The text was updated successfully, but these errors were encountered: