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

Fix flaky spring scheduling tests #12469

Merged
merged 3 commits into from
Oct 19, 2024

Conversation

@laurit laurit requested a review from a team as a code owner October 18, 2024 11:09
@github-actions github-actions bot added the test native This label can be applied to PRs to trigger them to run native tests label Oct 18, 2024
@@ -39,7 +39,7 @@
*/
@Aspect
final class SpringSchedulingInstrumentationAspect {
public static final String INSTRUMENTATION_NAME = "io.opentelemetry.spring-scheduling-3.1";
private static final String INSTRUMENTATION_NAME = "io.opentelemetry.spring-boot-autoconfigure";
Copy link
Contributor Author

@laurit laurit Oct 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instrumentation name should align with the module that contains the instrumentation code. It would probably be better to move this code elsewhere. cc @zeitlinger @jeanbisutti

OpenTelemetry.class,
R2DbcInstrumentationAutoConfigurationTest::openTelemetry);

private static OpenTelemetry openTelemetry() {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

an alternative would be to move this wrapping to the LibraryTestRunner @trask WDYT?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moving it makes sense to me, since LibraryTestRunner manages the SDK lifecycle

OpenTelemetry.class,
R2DbcInstrumentationAutoConfigurationTest::openTelemetry);

private static OpenTelemetry openTelemetry() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moving it makes sense to me, since LibraryTestRunner manages the SDK lifecycle

@@ -91,10 +97,8 @@ private LibraryTestRunner() {
@Override
public void beforeTestClass() {
// just in case: if there was any test that modified the global instance, reset it
if (GlobalOpenTelemetry.get() != openTelemetry) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed this check because I think it will always be true because GlobalOpenTelemetry wraps the instance used in set.

@trask trask merged commit 2140b7c into open-telemetry:main Oct 19, 2024
56 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test native This label can be applied to PRs to trigger them to run native tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants