Git Product home page Git Product logo

Comments (2)

mlboy avatar mlboy commented on August 22, 2024

just in go 1.14 version:

fail info:

==================
WARNING: DATA RACE
Read at 0x00c0000ab188 by goroutine 9:
  github.com/douyu/jupiter/pkg/util/xtime.(*rashTimer).newTimer()
      /home/travis/gopath/src/github.com/douyu/jupiter/pkg/util/xtime/rash_timer.go:293 +0x74
  github.com/douyu/jupiter/pkg/util/xtime.(*rashTimer).NewTimer()
      /home/travis/gopath/src/github.com/douyu/jupiter/pkg/util/xtime/rash_timer.go:377 +0xa7
  github.com/douyu/jupiter/pkg/util/xtime.TestTimer()
      /home/travis/gopath/src/github.com/douyu/jupiter/pkg/util/xtime/rash_timer_test.go:26 +0x52
  testing.tRunner()
      /home/travis/.gimme/versions/go1.14.4.linux.amd64/src/testing/testing.go:991 +0x1eb
Previous write at 0x00c0000ab188 by goroutine 10:
  github.com/douyu/jupiter/pkg/util/xtime.(*rashTimer).onTick()
      /home/travis/gopath/src/github.com/douyu/jupiter/pkg/util/xtime/rash_timer.go:234 +0x114
  github.com/douyu/jupiter/pkg/util/xtime.(*rashTimer).run()
      /home/travis/gopath/src/github.com/douyu/jupiter/pkg/util/xtime/rash_timer.go:311 +0xf0
Goroutine 9 (running) created at:
  testing.(*T).Run()
      /home/travis/.gimme/versions/go1.14.4.linux.amd64/src/testing/testing.go:1042 +0x660
  testing.runTests.func1()
      /home/travis/.gimme/versions/go1.14.4.linux.amd64/src/testing/testing.go:1284 +0xa6
  testing.tRunner()
      /home/travis/.gimme/versions/go1.14.4.linux.amd64/src/testing/testing.go:991 +0x1eb
  testing.runTests()
      /home/travis/.gimme/versions/go1.14.4.linux.amd64/src/testing/testing.go:1282 +0x527
  testing.(*M).Run()
      /home/travis/.gimme/versions/go1.14.4.linux.amd64/src/testing/testing.go:1199 +0x2ff
  main.main()
      _testmain.go:132 +0x337
Goroutine 10 (running) created at:
  github.com/douyu/jupiter/pkg/util/xtime.NewRashTimer()
      /home/travis/gopath/src/github.com/douyu/jupiter/pkg/util/xtime/rash_timer.go:164 +0x3b0
  github.com/douyu/jupiter/pkg/util/xtime.TestTimer()
      /home/travis/gopath/src/github.com/douyu/jupiter/pkg/util/xtime/rash_timer_test.go:25 +0x3b
  testing.tRunner()
      /home/travis/.gimme/versions/go1.14.4.linux.amd64/src/testing/testing.go:991 +0x1eb
==================
    TestTimer: testing.go:906: race detected during execution of test
--- FAIL: TestTimer (0.51s)

from jupiter.

mlboy avatar mlboy commented on August 22, 2024

奇怪的是在本地又没有复现出来

$-> go version

go version go1.14.4 darwin/amd64

$-> go test -v -race pkg/util/xtime/rash_timer_test.go pkg/util/xtime/rash_timer.go
=== RUN   TestTimer
--- PASS: TestTimer (0.50s)
PASS
ok  	command-line-arguments	0.730s

from jupiter.

Related Issues (20)

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.