Repository navigation
test(spring-boot): [Sample Tests 23] Port the Boot 3 OTel agent sample's Person, tracing and Todo tests - #6315
Draft
runningcode wants to merge 2 commits into
Conversation
This was referenced Oct 20, 2026
Draft
Draft
Draft
📲 Install BuildsAndroid
|
This was referenced Oct 20, 2026
Draft
Draft
This was referenced Oct 20, 2026
Draft
Draft
Draft
Draft
runningcode
force-pushed
the
no/boot3-otel-agent-integration-test
branch
from
October 21, 2026 09:19
ab6c994 to
ee9b468
Compare
…g and Todo tests The agent tests now start the fixture app once per test JVM and share it, because it takes seconds to start. Which mode initializes Sentry is a property of the test task, so the suite's task runs with the agent initializing it and a new integrationTestOtelAgentWithoutAutoInit task runs the same tests with the Spring Boot starter doing it. Gradle runs the two in parallel. The fixture gains the Person POST, distributed tracing and Todo endpoints, and the suite ports the agent sample's Person, DistributedTracing and Todo tests. Sentry exports the agent's spans in batches every 5 seconds, which can't be configured, so each test waits for the next batch and the negative tracing check waits past one. ChildJvmApp now copies the app's output into the test's as it arrives instead of printing it on close. The shared app is closed when the JVM exits, where its whole log would otherwise land on the console. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
runningcode
force-pushed
the
no/boot2-otel-noagent-integration-test
branch
from
October 21, 2026 11:27
ab1dda5 to
4910189
Compare
runningcode
force-pushed
the
no/boot3-otel-agent-integration-test
branch
from
October 21, 2026 11:27
ee9b468 to
4645281
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
Grows #6271's agent suite in
sentry-spring-boot-jakartafrom a single Person request into a port ofsentry-samples-spring-boot-jakarta-opentelemetry's Person, DistributedTracing and Todo tests. The sample's Cache, Metrics, GraphQL and Kafka tests follow in the next PR, which retires the sample.One app per test JVM. The fixture app runs in a child JVM with the built agent attached and takes seconds to start. It used to start once per test; now
AgentAppstarts it on first use, every test class shares it, and it stops when the JVM exits. The tests themselves are the no-agent suite's (#6312), adapted to the agent sample:@WithSpanis gone, because the agent sample doesn't use it.One task per init mode. Whether the agent or the Spring Boot starter initializes Sentry is now a property of the task:
integrationTestOtelAgentruns with the agent initializing Sentry.integrationTestOtelAgentWithoutAutoInitruns the same tests withSENTRY_AUTO_INIT=false, so the Spring Boot starter does it.Gradle runs the two in parallel. Both are in
check, the Boot 3 matrix andintegrationTests. The Person test still checks the SDK name, which shows that each mode takes its own init path.Speed. Sentry exports the agent's spans through a
BatchSpanProcessorwith a fixed 5-second schedule. In the app's JVM there's no way to flush it, as #6312 does in-process. Each test that waits for a transaction waits for the next batch, so the tests take about 5 seconds each: about 66s per mode for 13 tests, with both modes in parallel. The runner spent about 10 seconds per test. The unsampled-trace check waits 6 seconds, so it covers a full batch.App output.
ChildJvmAppnow copies the app's output into the test's as it arrives, rather than printing it onclose(). The shared app closes when the JVM exits, and its whole log (1,200 lines, mostly the stack traces of the intentionally failing requests) would otherwise land on the console. This way Gradle's test report shows each line with the test that was running.After a coverage audit against the sample's tests:
sample_randand deferred-sampling tests check the envelope header's trace ID.💡 Motivation and Context
These are the first in-module tests that exercise the agent in both init modes across Person, tracing and Todo. In CI, the sample's
auto-init=falserun restoressystemTestfrom cache, so it has likely never run.💚 How did you test it?
WithoutAutoInittask.AgentSmokeTeststill passes.:sentry-spring-boot-jakarta:checkand:sentry-test-support:checkpass.📝 Checklist
sendDefaultPIIis enabled.🔮 Next steps
The agent sample's Cache, Metrics, GraphQL and Kafka tests, which retire the sample.
#skip-changelog
🤖 Generated with Claude Code