Skip to content
New issue

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

BUG: Data race in ocmetrics.TestExportProtocolViolations_nodelessFirstMessage #41

Closed
tigrannajaryan opened this issue Jun 21, 2019 · 6 comments · Fixed by #747
Closed
Labels
bug Something isn't working help wanted Good issue for contributors to OpenTelemetry Service to pick up

Comments

@tigrannajaryan
Copy link
Member

Test randomly failed when building on Travis CI: https://travis-ci.org/open-telemetry/opentelemetry-service/builds/548680880?utm_source=github_status&utm_medium=notification

==================
WARNING: DATA RACE
Read at 0x00c0000ac143 by goroutine 36:
  testing.(*common).logDepth()
      /home/travis/.gimme/versions/go1.12.6.linux.amd64/src/testing/testing.go:629 +0x132
  testing.(*common).Log()
      /home/travis/.gimme/versions/go1.12.6.linux.amd64/src/testing/testing.go:614 +0x78
  github.com/open-telemetry/opentelemetry-service/receiver/opencensusreceiver/ocmetrics.TestExportProtocolViolations_nodelessFirstMessage.func1()
      /home/travis/gopath/src/github.com/open-telemetry/opentelemetry-service/receiver/opencensusreceiver/ocmetrics/opencensus_test.go:194 +0x202
Previous write at 0x00c0000ac143 by main goroutine:
  testing.tRunner.func1()
      /home/travis/.gimme/versions/go1.12.6.linux.amd64/src/testing/testing.go:856 +0x354
  testing.tRunner()
      /home/travis/.gimme/versions/go1.12.6.linux.amd64/src/testing/testing.go:869 +0x17f
  testing.runTests()
      /home/travis/.gimme/versions/go1.12.6.linux.amd64/src/testing/testing.go:1155 +0x523
  testing.(*M).Run()
      /home/travis/.gimme/versions/go1.12.6.linux.amd64/src/testing/testing.go:1072 +0x2eb
  main.main()
      _testmain.go:98 +0x334
Goroutine 36 (running) created at:
  github.com/open-telemetry/opentelemetry-service/receiver/opencensusreceiver/ocmetrics.TestExportProtocolViolations_nodelessFirstMessage()
      /home/travis/gopath/src/github.com/open-telemetry/opentelemetry-service/receiver/opencensusreceiver/ocmetrics/opencensus_test.go:189 +0x3fa
  testing.tRunner()
      /home/travis/.gimme/versions/go1.12.6.linux.amd64/src/testing/testing.go:865 +0x163
==================
panic: Log in goroutine after TestExportProtocolViolations_nodelessFirstMessage has completed
goroutine 51 [running]:
testing.(*common).logDepth(0xc00028a200, 0xc0000270e0, 0x18, 0x3)
	/home/travis/.gimme/versions/go1.12.6.linux.amd64/src/testing/testing.go:634 +0x51a
testing.(*common).log(...)
	/home/travis/.gimme/versions/go1.12.6.linux.amd64/src/testing/testing.go:614
testing.(*common).Log(0xc00028a200, 0xc000055750, 0x1, 0x1)
	/home/travis/.gimme/versions/go1.12.6.linux.amd64/src/testing/testing.go:642 +0x79
github.com/open-telemetry/opentelemetry-service/receiver/opencensusreceiver/ocmetrics.TestExportProtocolViolations_nodelessFirstMessage.func1(0xc00002c230, 0xc00028a200, 0x77359400, 0xc0002f5a20)
	/home/travis/gopath/src/github.com/open-telemetry/opentelemetry-service/receiver/opencensusreceiver/ocmetrics/opencensus_test.go:194 +0x203
created by github.com/open-telemetry/opentelemetry-service/receiver/opencensusreceiver/ocmetrics.TestExportProtocolViolations_nodelessFirstMessage
	/home/travis/gopath/src/github.com/open-telemetry/opentelemetry-service/receiver/opencensusreceiver/ocmetrics/opencensus_test.go:189 +0x3fb
FAIL	github.com/open-telemetry/opentelemetry-service/receiver/opencensusreceiver/ocmetrics	0.201s
ok  	github.com/open-telemetry/opentelemetry-service/receiver/opencensusreceiver/octrace	1.453s	coverage: 75.9% of statements
ok  	github.com/open-telemetry/opentelemetry-service/receiver/prometheusreceiver	6.282s	coverage: 79.4% of statements
?   	github.com/open-telemetry/opentelemetry-service/receiver/vmmetricsreceiver	[no test files]
ok  	github.com/open-telemetry/opentelemetry-service/receiver/zipkinreceiver	1.253s	coverage: 57.4% of statements
ok  	github.com/open-telemetry/opentelemetry-service/receiver/zipkinreceiver/zipkinscribereceiver	1.030s	coverage: 90.6% of statements
ok  	github.com/open-telemetry/opentelemetry-service/translator/trace	1.016s	coverage: 100.0% of statements
ok  	github.com/open-telemetry/opentelemetry-service/translator/trace/jaeger	1.073s	coverage: 85.4% of statements
ok  	github.com/open-telemetry/opentelemetry-service/translator/trace/spandata	1.034s	coverage: 65.0% of statements
ok  	github.com/open-telemetry/opentelemetry-service/translator/trace/zipkin	1.038s	coverage: 88.0% of statements
make: *** [test-with-cover] Error 1
The command "make travis-ci" exited with 2.
@tigrannajaryan tigrannajaryan added the bug Something isn't working label Jun 25, 2019
pjanotti referenced this issue in pjanotti/opentelemetry-service Jun 27, 2019
* Add initial occollector information

* Change client to library

* Slight re-wording
@flands flands added this to the 0.1.0 milestone Jun 28, 2019
@tigrannajaryan tigrannajaryan added the help wanted Good issue for contributors to OpenTelemetry Service to pick up label Jul 4, 2019
@tigrannajaryan tigrannajaryan removed this from the 0.1.0 milestone Jul 10, 2019
@huikang
Copy link
Member

huikang commented Dec 9, 2019

looks like it failed again: https://travis-ci.org/open-telemetry/opentelemetry-collector/builds/622115361#L298

ok  	github.com/open-telemetry/opentelemetry-collector/receiver/opencensusreceiver/ocmetrics	1.193s	coverage: 84.9% of statements
298==================
299WARNING: DATA RACE
300Read at 0x00c0002e8d43 by goroutine 99:
301  testing.(*common).logDepth()
302      /home/travis/.gimme/versions/go1.12.14.linux.amd64/src/testing/testing.go:621 +0x94
303  testing.(*common).Log()
304      /home/travis/.gimme/versions/go1.12.14.linux.amd64/src/testing/testing.go:614 +0x78
305  github.com/open-telemetry/opentelemetry-collector/receiver/opencensusreceiver/octrace.TestExportProtocolViolations_nodelessFirstMessage.func1()
306      /home/travis/gopath/src/github.com/open-telemetry/opentelemetry-collector/receiver/opencensusreceiver/octrace/opencensus_test.go:319 +0x202
307
308Previous write at 0x00c0002e8d43 by goroutine 82:
309  testing.tRunner.func1()
310      /home/travis/.gimme/versions/go1.12.14.linux.amd64/src/testing/testing.go:856 +0x354
311  testing.tRunner()
312      /home/travis/.gimme/versions/go1.12.14.linux.amd64/src/testing/testing.go:869 +0x17f
313
314Goroutine 99 (running) created at:
315  github.com/open-telemetry/opentelemetry-collector/receiver/opencensusreceiver/octrace.TestExportProtocolViolations_nodelessFirstMessage()
316      /home/travis/gopath/src/github.com/open-telemetry/opentelemetry-collector/receiver/opencensusreceiver/octrace/opencensus_test.go:314 +0x3c0
317  testing.tRunner()
318      /home/travis/.gimme/versions/go1.12.14.linux.amd64/src/testing/testing.go:865 +0x163
319
320Goroutine 82 (running) created at:
321  testing.(*T).Run()
322      /home/travis/.gimme/versions/go1.12.14.linux.amd64/src/testing/testing.go:916 +0x65a
323  testing.runTests.func1()
324      /home/travis/.gimme/versions/go1.12.14.linux.amd64/src/testing/testing.go:1157 +0xa8
325  testing.tRunner()
326      /home/travis/.gimme/versions/go1.12.14.linux.amd64/src/testing/testing.go:865 +0x163
327  testing.runTests()
328      /home/travis/.gimme/versions/go1.12.14.linux.amd64/src/testing/testing.go:1155 +0x523
329  testing.(*M).Run()
330      /home/travis/.gimme/versions/go1.12.14.linux.amd64/src/testing/testing.go:1072 +0x2eb
331  main.main()
332      _testmain.go:106 +0x334
333==================

@pjanotti
Copy link
Contributor

Another instance. Test failed on #454

==================
WARNING: DATA RACE
Read at 0x00c000113a43 by goroutine 99:
  testing.(*common).logDepth()
      /home/travis/.gimme/versions/go1.12.14.linux.amd64/src/testing/testing.go:621 +0x94
  testing.(*common).Log()
      /home/travis/.gimme/versions/go1.12.14.linux.amd64/src/testing/testing.go:614 +0x78
  github.com/open-telemetry/opentelemetry-collector/receiver/opencensusreceiver/octrace.TestExportProtocolViolations_nodelessFirstMessage.func1()
      /home/travis/gopath/src/github.com/open-telemetry/opentelemetry-collector/receiver/opencensusreceiver/octrace/opencensus_test.go:319 +0x202
Previous write at 0x00c000113a43 by goroutine 82:
  testing.tRunner.func1()
      /home/travis/.gimme/versions/go1.12.14.linux.amd64/src/testing/testing.go:856 +0x354
  testing.tRunner()
      /home/travis/.gimme/versions/go1.12.14.linux.amd64/src/testing/testing.go:869 +0x17f
Goroutine 99 (running) created at:
  github.com/open-telemetry/opentelemetry-collector/receiver/opencensusreceiver/octrace.TestExportProtocolViolations_nodelessFirstMessage()
      /home/travis/gopath/src/github.com/open-telemetry/opentelemetry-collector/receiver/opencensusreceiver/octrace/opencensus_test.go:314 +0x3c0
  testing.tRunner()
      /home/travis/.gimme/versions/go1.12.14.linux.amd64/src/testing/testing.go:865 +0x163
Goroutine 82 (running) created at:
  testing.(*T).Run()
      /home/travis/.gimme/versions/go1.12.14.linux.amd64/src/testing/testing.go:916 +0x65a
  testing.runTests.func1()
      /home/travis/.gimme/versions/go1.12.14.linux.amd64/src/testing/testing.go:1157 +0xa8
  testing.tRunner()
      /home/travis/.gimme/versions/go1.12.14.linux.amd64/src/testing/testing.go:865 +0x163
  testing.runTests()
      /home/travis/.gimme/versions/go1.12.14.linux.amd64/src/testing/testing.go:1155 +0x523
  testing.(*M).Run()
      /home/travis/.gimme/versions/go1.12.14.linux.amd64/src/testing/testing.go:1072 +0x2eb
  main.main()
      _testmain.go:54 +0x222
==================
FAIL
FAIL	github.com/open-telemetry/opentelemetry-collector/receiver/opencensusreceiver/octrace	0.443s

@tigrannajaryan
Copy link
Member Author

@pjanotti
Copy link
Contributor

Looking...

tigrannajaryan pushed a commit that referenced this issue Mar 30, 2020
Fix race in TestExportProtocolViolations_nodelessFirstMessage. The race is on the t *testing.T having one of its fields being read and write concurrently. I didn't investigate why this test needs this special timeout handling, just took the obvious fix to protect against the data race - will look at this again later.

Fixes #41
MovieStoreGuy pushed a commit to atlassian-forks/opentelemetry-collector that referenced this issue Nov 11, 2021
* fix compile errors.

* fix lint errors.

* add circle-ci job.

* rename IDHigh to TraceIDHigh

* rename the file.

* add go get for goimports and golangci-lint

* enable GO111MODULE and remove comments.

* remove working dir and update cache name

* Add TEST_RESULT env back.

* run go mod tidy.

* remove go mod download.

* add test coverage.

* fix TraceID.

* fix circlefi config error.

* remove install-tools.

* remove ALL_TEST_SRC from Makefile.
Troels51 pushed a commit to Troels51/opentelemetry-collector that referenced this issue Jul 5, 2024
This is to ensure OpenTelemetry works without exception handling.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Good issue for contributors to OpenTelemetry Service to pick up
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants