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

Flaky semaphore test #361

Closed
rubvs opened this issue Sep 5, 2024 · 0 comments · Fixed by #391
Closed

Flaky semaphore test #361

rubvs opened this issue Sep 5, 2024 · 0 comments · Fixed by #391
Assignees
Labels
bug Something isn't working

Comments

@rubvs
Copy link
Contributor

rubvs commented Sep 5, 2024

Test failure when running make test with -race enabled:

=== RUN   TestConsumeLogsSemaphore
panic: test timed out after 10m0s
running tests:
	TestConsumeLogsSemaphore (10m0s)

goroutine 130 [running]:
testing.(*M).startAlarm.func1()
	/usr/local/go/src/testing/testing.go:2366 +0x265
created by time.goFunc
	/usr/local/go/src/time/sleep.go:177 +0x45

goroutine 1 [chan receive, 9 minutes]:
testing.(*T).Run(0xc0003d41a0, {0x103362ede, 0x18}, 0x1037051e0)
	/usr/local/go/src/testing/testing.go:1750 +0x851
testing.runTests.func1(0xc0003d41a0)
	/usr/local/go/src/testing/testing.go:2161 +0x86
testing.tRunner(0xc0003d41a0, 0xc0004dfb10)
	/usr/local/go/src/testing/testing.go:1689 +0x21f
testing.runTests(0xc0003569d8, {0x103daec40, 0x46, 0x46}, {0xc0004dfbb8?, 0xc0004dfc00?, 0x103e076e0?})
	/usr/local/go/src/testing/testing.go:2159 +0x8bf
testing.(*M).Run(0xc00036d2c0)
	/usr/local/go/src/testing/testing.go:2027 +0xf18
main.main()
	_testmain.go:187 +0x2be

goroutine 123 [chan receive, 9 minutes]:
github.com/elastic/apm-data/input/otlp_test.TestConsumeLogsSemaphore.func1({0xc0000d1c48?, 0x102416989?}, 0xc0005657a0)
	/Users/rubenvanstaden/github/elastic/apm-data/input/otlp/logs_test.go:231 +0x51
github.com/elastic/apm-data/model/modelpb.ProcessBatchFunc.ProcessBatch(0xc0001209f0, {0x103716b58, 0xc000132bd0}, 0xc0005657a0)
	/Users/rubenvanstaden/github/elastic/apm-data/model/modelpb/batch.go:42 +0x48
github.com/elastic/apm-data/input/otlp.(*Consumer).ConsumeLogsWithResult(0xc000161ec0, {0x103716b58, 0xc000132bd0}, {0xc0001209c0?, 0xc000664d2c?})
	/Users/rubenvanstaden/github/elastic/apm-data/input/otlp/logs.go:79 +0x5ca
github.com/elastic/apm-data/input/otlp_test.TestConsumeLogsSemaphore(0xc00022e9c0)
	/Users/rubenvanstaden/github/elastic/apm-data/input/otlp/logs_test.go:251 +0x4d2
testing.tRunner(0xc00022e9c0, 0x1037051e0)
	/usr/local/go/src/testing/testing.go:1689 +0x21f
created by testing.(*T).Run in goroutine 1
	/usr/local/go/src/testing/testing.go:1742 +0x826

goroutine 124 [select, 9 minutes]:
golang.org/x/sync/semaphore.(*Weighted).Acquire(0xc0001a4320, {0x103716a40, 0x104daf080}, 0x1)
	/Users/rubenvanstaden/go/pkg/mod/golang.org/x/[email protected]/semaphore/semaphore.go:74 +0x57a
github.com/elastic/apm-data/input/otlp.semAcquire({0x103716a40, 0x104daf080}, {0x103713358, 0xc0001a4320}, 0x1)
	/Users/rubenvanstaden/github/elastic/apm-data/input/otlp/trace_semaphore.go:32 +0x156
github.com/elastic/apm-data/input/otlp.(*Consumer).ConsumeLogsWithResult(0xc000161ec0, {0x103716a40, 0x104daf080}, {0xc0001209c0?, 0xc000664d2c?})
	/Users/rubenvanstaden/github/elastic/apm-data/input/otlp/logs.go:67 +0xd2
github.com/elastic/apm-data/input/otlp_test.TestConsumeLogsSemaphore.func2()
	/Users/rubenvanstaden/github/elastic/apm-data/input/otlp/logs_test.go:244 +0x75
created by github.com/elastic/apm-data/input/otlp_test.TestConsumeLogsSemaphore in goroutine 123
	/Users/rubenvanstaden/github/elastic/apm-data/input/otlp/logs_test.go:242 +0x454
FAIL	github.com/elastic/apm-data/input/otlp	601.765s

Reproduce

go clean -testcache
go test -race -v -failfast ./input/otlp
@rubvs rubvs added the bug Something isn't working label Sep 5, 2024
@rubvs rubvs self-assigned this Sep 5, 2024
@rubvs rubvs closed this as completed in #391 Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant