Repository navigation
test(spring-boot): [Sample Tests 26] Move the Boot 2 OTel agent sample's tests - #6318
Draft
runningcode wants to merge 3 commits into
Draft
runningcode wants to merge 3 commits into
runningcode wants to merge 3 commits into
Conversation
This was referenced Oct 20, 2026
Draft
Draft
Draft
Draft
📲 Install BuildsAndroid
|
This was referenced Oct 20, 2026
Draft
This was referenced Oct 20, 2026
Draft
Draft
Open
runningcode
force-pushed
the
no/boot4-otel-agent-integration-test
branch
from
October 21, 2026 09:19
8f92797 to
cc210fd
Compare
runningcode
force-pushed
the
no/boot2-otel-agent-integration-test
branch
from
October 21, 2026 09:19
e479618 to
96b1a84
Compare
runningcode
force-pushed
the
no/boot4-otel-agent-integration-test
branch
from
October 21, 2026 11:27
cc210fd to
5443f5c
Compare
runningcode
force-pushed
the
no/boot2-otel-agent-integration-test
branch
from
October 21, 2026 11:27
96b1a84 to
789606b
Compare
romtsn
reviewed
Oct 22, 2026
Contributor
There was a problem hiding this comment.
did not verify if this is true but my clanker found:
- test(spring-boot): [Sample Tests 26] Move the Boot 2 OTel agent sample's tests #6318, the Boot 2 AgentApp can leak child JVMs and waste about 24 minutes of CI. I checked this one in the code (sentry-spring-boot/src/integrationTestOtelAgent/.../AgentApp.kt).
- shared by lazy { AgentApp().also { addShutdownHook } } creates the app, and the constructor calls awaitPort(180). If that call throws, the shutdown hook is never registered, so the child JVM keeps running
after the tests.- Kotlin lazy does not store an exception. Each later test class therefore starts a new JVM and waits 180s again. With about 8 classes, that is about 24 minutes and about 8 leaked JVMs.
- Fix: register the hook directly after ChildJvmApp.start, and store the failure. Or use the object pattern from Boot 3/4.
- Also: if the AgentApp in @BeforeClass throws, KafkaOtelCoexistenceIntegrationTest.kt:61-79 sees an uninitialized kafkaApp in @afterclass. The broker and the child JVM then leak. Use a nullable field and
try/finally.
runningcode
force-pushed
the
no/boot2-otel-agent-integration-test
branch
from
October 22, 2026 12:40
789606b to
996ba71
Compare
runningcode
force-pushed
the
no/boot4-otel-agent-integration-test
branch
from
October 22, 2026 12:40
5443f5c to
4caac3b
Compare
runningcode
force-pushed
the
no/boot2-otel-agent-integration-test
branch
from
October 22, 2026 13:31
996ba71 to
9d93849
Compare
runningcode
force-pushed
the
no/boot4-otel-agent-integration-test
branch
2 times, most recently
from
October 22, 2026 14:02
5a4e631 to
55007b3
Compare
runningcode
force-pushed
the
no/boot2-otel-agent-integration-test
branch
from
October 22, 2026 14:02
9d93849 to
0cf9ee7
Compare
… module Adds the agent setup to sentry-spring-boot, as in the Boot 3 and 4 modules. The sample's tests were the Boot 3 agent sample's minus Cache and RestClient, which Boot 2 doesn't have. GraphQL and Kafka are gated on Boot 2.7, as in the other Boot 2 suites. The shared app has to start on Boot versions without Kafka support, so the Kafka test starts an app of its own with the kafka profile and an in-JVM broker. AgentApp becomes a class for that, with the shared instance in its companion. The sample has no system tests left, so it comes off the system-test runner, the backend workflow and the Spring Boot 2 matrix, which now runs both agent tasks and no longer builds the agent separately. integrationTests includes them too. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…oot 2 agent Ports the tracing and GraphQL checks to the Boot 2 agent suite, and gives the app three minutes to start, as for Boot 3 and 4. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
runningcode
force-pushed
the
no/boot2-otel-agent-integration-test
branch
from
October 22, 2026 16:02
0ca29e4 to
bd965ea
Compare
runningcode
force-pushed
the
no/boot4-otel-agent-integration-test
branch
from
October 22, 2026 16:02
55007b3 to
82f52fb
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Stack (Sample Tests)
main)📜 Description
Moves
sentry-samples-spring-boot-opentelemetry's tests intosentry-spring-boot. It adds the agent setup from #6315 and #6317: anagentFixtureapp, theintegrationTestOtelAgentsuite and theintegrationTestOtelAgentWithoutAutoInittask.The sample's tests are the Boot 3 agent sample's minus Cache and RestClient (Boot 2 has no RestClient). So the fixture and tests are #6316's, with the Boot 2 changes the other Boot 2 suites (#6299, #6314) already make:
Kafka gets an app of its own. The shared app has to start on Boot versions without Kafka support. So the Kafka test starts its own broker (spring-kafka 2.8's, with ZooKeeper) and a second fixture app with the
kafkaprofile. This is the agent version of the separate Kafka context in #6300 and #6314.AgentAppbecomes a class for this, with the shared instance in its companion. The base class'sappis the shared one unless a test overrides it.The sample only checked the project query span's op. The full op and description check passes on Boot 2 too, as it does on 3 and 4.
With no system tests left, the sample comes off the runner, the backend workflow and the Spring Boot 2 matrix. The matrix now runs both agent tasks and no longer builds the agent separately.
integrationTestsincludes the tasks too.This was the last sample with the agent. All three Boot lines now test the agent in both init modes.
After a coverage audit against the sample's tests:
sample_randand deferred-sampling tests check the envelope header's trace ID, the GraphQL task query'sassigneeIdandcreatorIdchecks from test(spring-boot): [Sample Tests 9] Move the Boot 3 GraphQL tests into the module #6295, and three minutes for the app to start instead of one, as in test(spring-boot): [Sample Tests 23] Port the Boot 3 OTel agent sample's Person, tracing and Todo tests #6315: on a busy CI runner the agent's instrumentation took over a minute.💡 Motivation and Context
The Boot 2 agent flavor now runs in the module in both init modes. Each task runs 22 tests in about 112s, or 15 below Boot 2.7.
💚 How did you test it?
WithoutAutoInittask.:sentry-spring-boot:checkpasses, and the sample still builds.📝 Checklist
sendDefaultPIIis enabled.🔮 Next steps
The Spring WAR samples (
sentry-spring,sentry-spring-jakarta,sentry-spring-7).#skip-changelog
🤖 Generated with Claude Code