Skip to content

[chore][receiver/skywalking] don't use t.Context() in t.Cleanup()#43004

Merged
atoulme merged 4 commits into
open-telemetry:mainfrom
VihasMakwana:skywalking-test-fix
Sep 26, 2025
Merged

[chore][receiver/skywalking] don't use t.Context() in t.Cleanup()#43004
atoulme merged 4 commits into
open-telemetry:mainfrom
VihasMakwana:skywalking-test-fix

Conversation

@VihasMakwana
Copy link
Copy Markdown
Contributor

@VihasMakwana VihasMakwana commented Sep 26, 2025

Description

As per t.Context()'s documentation,

Context returns a context that is canceled just before Cleanup-registered functions are called.

Meaning, this context is already cancelled while calling receiver.Shutdown(ctx). The Shutdown method might return context cancelled error and result in test case failure.
Fix this by moving Shutdown into a defer call.

Link to tracking issue

Fixes #42954

Comment thread receiver/skywalkingreceiver/skywalking_receiver_test.go Outdated
@VihasMakwana VihasMakwana added the flaky tests Tests failed on main. Formerly known as 'broken tests' label Sep 26, 2025
@atoulme atoulme merged commit 05715e3 into open-telemetry:main Sep 26, 2025
203 checks passed
@github-actions github-actions Bot added this to the next release milestone Sep 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

flaky tests Tests failed on main. Formerly known as 'broken tests' receiver/skywalking

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[receiver/skywalkingreceiver]: Report for failed tests on main

4 participants