kamilsk / retry

♻️ The most advanced interruptible mechanism to perform actions repetitively until successful.
https://pkg.go.dev/github.com/kamilsk/retry/v5
MIT License
340 stars 14 forks source link

race in examples #113

Closed kamilsk closed 6 years ago

kamilsk commented 6 years ago
make test
go list ./... | grep -v vendor | grep -v ^_ | xargs go test -race 
==================
WARNING: DATA RACE
Read at 0x00c42008e4d8 by goroutine 62:
  github.com/kamilsk/retry_test.Example_httpClient.func1()
      /Users/kamilsk/Development/go/src/github.com/kamilsk/retry/example_http_client_test.go:43 +0x4a
  net/http.HandlerFunc.ServeHTTP()
      /usr/local/Cellar/go/1.10/libexec/src/net/http/server.go:1947 +0x51
  net/http.serverHandler.ServeHTTP()
      /usr/local/Cellar/go/1.10/libexec/src/net/http/server.go:2694 +0xb9
  net/http.(*conn).serve()
      /usr/local/Cellar/go/1.10/libexec/src/net/http/server.go:1830 +0x7dc

Previous write at 0x00c42008e4d8 by goroutine 57:
  github.com/kamilsk/retry_test.Example_httpClient.func1()
      /Users/kamilsk/Development/go/src/github.com/kamilsk/retry/example_http_client_test.go:47 +0xd9
  net/http.HandlerFunc.ServeHTTP()
      /usr/local/Cellar/go/1.10/libexec/src/net/http/server.go:1947 +0x51
  net/http.serverHandler.ServeHTTP()
      /usr/local/Cellar/go/1.10/libexec/src/net/http/server.go:2694 +0xb9
  net/http.(*conn).serve()
      /usr/local/Cellar/go/1.10/libexec/src/net/http/server.go:1830 +0x7dc

Goroutine 62 (running) created at:
  net/http.(*Server).Serve()
      /usr/local/Cellar/go/1.10/libexec/src/net/http/server.go:2795 +0x364
  net/http/httptest.(*Server).goServe.func1()
      /usr/local/Cellar/go/1.10/libexec/src/net/http/httptest/server.go:280 +0xa2

Goroutine 57 (running) created at:
  net/http.(*Server).Serve()
      /usr/local/Cellar/go/1.10/libexec/src/net/http/server.go:2795 +0x364
  net/http/httptest.(*Server).goServe.func1()
      /usr/local/Cellar/go/1.10/libexec/src/net/http/httptest/server.go:280 +0xa2
==================
FAIL
FAIL    github.com/kamilsk/retry        0.685s
ok      github.com/kamilsk/retry/backoff        1.024s
ok      github.com/kamilsk/retry/classifier     1.029s
ok      github.com/kamilsk/retry/cmd/retry      1.047s
ok      github.com/kamilsk/retry/jitter 1.024s
ok      github.com/kamilsk/retry/strategy       1.185s