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 Test][exporter/file] TestComponentLifecycle/logs-lifecycle: file already closed #31494

Closed
crobert-1 opened this issue Feb 29, 2024 · 3 comments · Fixed by #31495
Closed
Labels
exporter/file flaky test a test is flaky needs triage New item requiring triage

Comments

@crobert-1
Copy link
Member

Component(s)

exporter/file

Describe the issue you're reporting

Failed CI run: https://github.com/open-telemetry/opentelemetry-collector-contrib/actions/runs/8088907082/job/22103913709?pr=31050

Failed test output:

Running target 'test-with-cover' in module 'exporter/fileexporter' as part of group 'exporter-0'
make --no-print-directory -C exporter/fileexporter test-with-cover
mkdir -p /home/runner/work/opentelemetry-collector-contrib/opentelemetry-collector-contrib/coverage/unit
/home/runner/work/opentelemetry-collector-contrib/opentelemetry-collector-contrib/.tools/gotestsum --rerun-fails=1 --packages="./..." -- -race -timeout 300s -parallel 4 --tags="" -cover -covermode=atomic -args -test.gocoverdir="/home/runner/work/opentelemetry-collector-contrib/opentelemetry-collector-contrib/coverage/unit"
∅  internal/metadata
✖  . (1.615s)

=== Failed
ERROR rerun aborted because previous run had a suspected panic and some test may not have run
=== FAIL: . TestComponentLifecycle/logs-lifecycle (0.00s)
    generated_component_test.go:105: 
        	Error Trace:	/home/runner/work/opentelemetry-collector-contrib/opentelemetry-collector-contrib/exporter/fileexporter/generated_component_test.go:105
        	Error:      	Received unexpected error:
        	            	write testdata/log.json: file already closed
        	            	close testdata/log.json: file already closed
        	Test:       	TestComponentLifecycle/logs-lifecycle

make[2]: *** [../../Makefile.Common:131: test-with-cover] Error 3
make[1]: *** [Makefile:165: exporter/fileexporter] Error 2
make: *** [Makefile:117: gotest-with-cover] Error 2
=== FAIL: . TestComponentLifecycle/metrics-shutdown (0.00s)

=== FAIL: . TestComponentLifecycle (0.00s)
panic: close of closed channel [recovered]
	panic: close of closed channel

goroutine 100 [running]:
testing.tRunner.func1.2({0x10f7940, 0x1357df0})
	/opt/hostedtoolcache/go/1.21.7/x64/src/testing/testing.go:1545 +0x3f7
testing.tRunner.func1()
	/opt/hostedtoolcache/go/1.21.7/x64/src/testing/testing.go:1548 +0x716
panic({0x10f7940?, 0x1357df0?})
	/opt/hostedtoolcache/go/1.21.7/x64/src/runtime/panic.go:920 +0x270
github.com/open-telemetry/opentelemetry-collector-contrib/exporter/fileexporter.(*fileWriter).shutdown(0xc000320af0)
	/home/runner/work/opentelemetry-collector-contrib/opentelemetry-collector-contrib/exporter/fileexporter/file_writer.go:104 +0x176
github.com/open-telemetry/opentelemetry-collector-contrib/exporter/fileexporter.(*fileExporter).Shutdown(0xc00019b760, {0xc0000c7b88, 0xf227dd})
	/home/runner/work/opentelemetry-collector-contrib/opentelemetry-collector-contrib/exporter/fileexporter/file_exporter.go:53 +0x8b
go.opentelemetry.io/collector/component.ShutdownFunc.Shutdown(...)
	/home/runner/go/pkg/mod/go.opentelemetry.io/collector/[email protected]/component.go:84
go.opentelemetry.io/collector/exporter/exporterhelper.(*baseExporter).Shutdown(0xc0002d2280, {0x1363178, 0x19bea80})
	/home/runner/go/pkg/mod/go.opentelemetry.io/collector/[email protected]/exporterhelper/common.go:243 +0x119
github.com/open-telemetry/opentelemetry-collector-contrib/exporter/fileexporter.TestComponentLifecycle.func4(0x0?)
	/home/runner/work/opentelemetry-collector-contrib/opentelemetry-collector-contrib/exporter/fileexporter/generated_component_test.go:70 +0x1ac
testing.tRunner(0xc00033aea0, 0xc00004d780)
	/opt/hostedtoolcache/go/1.21.7/x64/src/testing/testing.go:1595 +0x[262](https://github.com/open-telemetry/opentelemetry-collector-contrib/actions/runs/8088907082/job/22103913709?pr=31050#step:9:263)
created by testing.(*T).Run in goroutine 96
	/opt/hostedtoolcache/go/1.21.7/x64/src/testing/testing.go:1648 +0x846

=== FAIL: . TestBufferedWrites (unknown)

=== FAIL: . TestLoadConfig (unknown)

DONE 42 tests, 5 failures in 2.675s
make[1]: Leaving directory '/home/runner/work/opentelemetry-collector-contrib/opentelemetry-collector-contrib'
Error: Process completed with exit code 2.
@crobert-1 crobert-1 added the needs triage New item requiring triage label Feb 29, 2024
Copy link
Contributor

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@crobert-1
Copy link
Member Author

@crobert-1
Copy link
Member Author

dmitryax pushed a commit that referenced this issue Feb 29, 2024
…lifecycle (#31495)

**Description:**
Scope the behavior of the fileexporter to its lifecycle, so it is safe
to shut it down or restart it.

**Link to tracking Issue:**
Fixes #31494
XinRanZhAWS pushed a commit to XinRanZhAWS/opentelemetry-collector-contrib that referenced this issue Mar 13, 2024
…lifecycle (open-telemetry#31495)

**Description:**
Scope the behavior of the fileexporter to its lifecycle, so it is safe
to shut it down or restart it.

**Link to tracking Issue:**
Fixes open-telemetry#31494
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
exporter/file flaky test a test is flaky needs triage New item requiring triage
Projects
None yet
1 participant