Skip to content

Commit a5b5c71

Browse files
committed
Merge the audit fixes from the branches below, and document the test client and log4j2 suite
The context's TestRestTemplate adds trace headers of its own whenever Sentry customizes the RestTemplateBuilder, not only in OpenTelemetry mode, and the Spring Boot modules have an integrationTestLog4j2 suite. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
1 parent b4b921f commit a5b5c71

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

‎.cursor/rules/e2e_tests.mdc‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ match on values only they produce.
4343
- `integrationTestOtelNoAgent`: `sentry-opentelemetry-agentless-spring`.
4444
- `integrationTestOtelAgent` and `integrationTestOtelAgentWithoutAutoInit`: the built agent.
4545
- `integrationTestOtlp` (Boot 4): `sentry-opentelemetry-otlp-spring`.
46+
- `integrationTestLog4j2` (Boot 3, 4): Log4j2 instead of Logback, for the auto-configured
47+
Log4j2 appender.
4648

4749
Each suite has a base class with `@SpringBootTest(RANDOM_PORT)` and a `@DynamicPropertySource`
4850
that sets `sentry.dsn`. Subclasses share one context and one server.
@@ -68,8 +70,9 @@ it. Gradle runs the two in parallel.
6870

6971
## Gotchas
7072

71-
- In OpenTelemetry mode, the OpenTelemetry starter instruments the context's `TestRestTemplate`,
72-
which then replaces the trace headers a test sends. Build one outside the context instead.
73+
- Don't use the context's `TestRestTemplate`. It comes from the `RestTemplateBuilder` that Sentry
74+
customizes, and that the OpenTelemetry starter instruments, so it adds or replaces trace headers
75+
on the requests a test sends. Build one outside the context.
7376
- Sentry exports OpenTelemetry spans in batches every 5 seconds. In-process, flush the tracer
7477
provider from the server's hook. With the agent this isn't possible, so each test waits for a
7578
batch and negative checks wait at least 6 seconds.

0 commit comments

Comments
 (0)