Coder Social home page Coder Social logo

activity's People

Contributors

bzimmer avatar

Watchers

 avatar  avatar

Forkers

thirdeyenick

activity's Issues

zwift authentication tests fail with race condition

~/Development/src/github.com/bzimmer/activity (actions) > task test
task: [build:dist] mkdir -p /Users/bzimmer/Development/src/github.com/bzimmer/activity/dist
task: [build:test] go test  -timeout 20s -race -count=1 -covermode atomic -coverprofile /Users/bzimmer/Development/src/github.com/bzimmer/activity/dist/coverage.txt ./...
ok      github.com/bzimmer/activity     0.178s  coverage: 92.2% of statements
ok      github.com/bzimmer/activity/cyclinganalytics    0.173s  coverage: 84.1% of statements
ok      github.com/bzimmer/activity/rwgps       0.288s  coverage: 66.1% of statements
ok      github.com/bzimmer/activity/strava      0.590s  coverage: 82.2% of statements
==================
WARNING: DATA RACE
Write at 0x00c00001e7f0 by goroutine 11:
  runtime.recvDirect()
      /opt/homebrew/Cellar/go/1.20.3/libexec/src/runtime/chan.go:348 +0x7c
  github.com/bzimmer/activity/zwift_test.TestTokenRefresh.func1()
      /Users/bzimmer/Development/src/github.com/bzimmer/activity/zwift/zwift_test.go:138 +0x8e8
  testing.tRunner()
      /opt/homebrew/Cellar/go/1.20.3/libexec/src/testing/testing.go:1576 +0x188
  testing.(*T).Run.func1()
      /opt/homebrew/Cellar/go/1.20.3/libexec/src/testing/testing.go:1629 +0x40

Previous read at 0x00c00001e7f0 by goroutine 286:
  runtime.chansend1()
      /opt/homebrew/Cellar/go/1.20.3/libexec/src/runtime/chan.go:146 +0x2c
  github.com/bzimmer/activity/zwift_test.tokenMux.func1()
      /Users/bzimmer/Development/src/github.com/bzimmer/activity/zwift/zwift_test.go:44 +0xd8
  net/http.HandlerFunc.ServeHTTP()
      /opt/homebrew/Cellar/go/1.20.3/libexec/src/net/http/server.go:2122 +0x48
  net/http.(*ServeMux).ServeHTTP()
      /opt/homebrew/Cellar/go/1.20.3/libexec/src/net/http/server.go:2500 +0x9c
  net/http.serverHandler.ServeHTTP()
      /opt/homebrew/Cellar/go/1.20.3/libexec/src/net/http/server.go:2936 +0x548
  net/http.(*conn).serve()
      /opt/homebrew/Cellar/go/1.20.3/libexec/src/net/http/server.go:1995 +0x8d8
  net/http.(*Server).Serve.func3()
      /opt/homebrew/Cellar/go/1.20.3/libexec/src/net/http/server.go:3089 +0x4c

Goroutine 11 (running) created at:
  testing.(*T).Run()
      /opt/homebrew/Cellar/go/1.20.3/libexec/src/testing/testing.go:1629 +0x5e4
  github.com/bzimmer/activity/zwift_test.TestTokenRefresh()
      /Users/bzimmer/Development/src/github.com/bzimmer/activity/zwift/zwift_test.go:92 +0x128
  testing.tRunner()
      /opt/homebrew/Cellar/go/1.20.3/libexec/src/testing/testing.go:1576 +0x188
  testing.(*T).Run.func1()
      /opt/homebrew/Cellar/go/1.20.3/libexec/src/testing/testing.go:1629 +0x40

Goroutine 286 (running) created at:
  net/http.(*Server).Serve()
      /opt/homebrew/Cellar/go/1.20.3/libexec/src/net/http/server.go:3089 +0x620
  net/http/httptest.(*Server).goServe.func1()
      /opt/homebrew/Cellar/go/1.20.3/libexec/src/net/http/httptest/server.go:310 +0xa0
==================
2023/04/25 06:52:52 http: panic serving 127.0.0.1:53457: send on closed channel
goroutine 330 [running]:
net/http.(*conn).serve.func1()
        /opt/homebrew/Cellar/go/1.20.3/libexec/src/net/http/server.go:1854 +0xe4
panic({0x104f9a280, 0x105001130})
        /opt/homebrew/Cellar/go/1.20.3/libexec/src/runtime/panic.go:890 +0x258
github.com/bzimmer/activity/zwift_test.tokenMux.func1({0x105004540, 0xc0008ec000}, 0xc000529200)
        /Users/bzimmer/Development/src/github.com/bzimmer/activity/zwift/zwift_test.go:41 +0xf8
net/http.HandlerFunc.ServeHTTP(0xc00000c480, {0x105004540, 0xc0008ec000}, 0x104e391c0?)
        /opt/homebrew/Cellar/go/1.20.3/libexec/src/net/http/server.go:2122 +0x4c
net/http.(*ServeMux).ServeHTTP(0x0?, {0x105004540, 0xc0008ec000}, 0xc000529200)
        /opt/homebrew/Cellar/go/1.20.3/libexec/src/net/http/server.go:2500 +0xa0
net/http.serverHandler.ServeHTTP({0x105003340?}, {0x105004540, 0xc0008ec000}, 0xc000529200)
        /opt/homebrew/Cellar/go/1.20.3/libexec/src/net/http/server.go:2936 +0x54c
net/http.(*conn).serve(0xc0005255f0, {0x105004858, 0xc0001160c0})
        /opt/homebrew/Cellar/go/1.20.3/libexec/src/net/http/server.go:1995 +0x8dc
created by net/http.(*Server).Serve
        /opt/homebrew/Cellar/go/1.20.3/libexec/src/net/http/server.go:3089 +0x624
--- FAIL: TestTokenRefresh (1.01s)
    zwift_test.go:137: 
                Error Trace:    /Users/bzimmer/Development/src/github.com/bzimmer/activity/zwift/zwift_test.go:137
                Error:          Received unexpected error:
                                context deadline exceeded
                Test:           TestTokenRefresh
    zwift_test.go:153: 
                Error Trace:    /Users/bzimmer/Development/src/github.com/bzimmer/activity/zwift/zwift_test.go:153
                Error:          Not equal: 
                                expected: 100
                                actual  : 99
                Test:           TestTokenRefresh
    --- FAIL: TestTokenRefresh/success_100 (1.01s)
        testing.go:1446: race detected during execution of test
    testing.go:1446: race detected during execution of test
FAIL
        github.com/bzimmer/activity/zwift       coverage: 49.0% of statements
FAIL    github.com/bzimmer/activity/zwift       1.397s
FAIL
task: Failed to run task "test": task: Failed to run task "build:test": exit status 1
task: Failed to run task "test": task: Failed to run task "build:test": exit status 1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.