Skip to content

test(cache): [Cache Tracing 23] Add missing cache key assertions and use exact equals#5228

Merged
adinauer merged 2 commits intofeat/cache-tracingfrom
feat/cache-tracing-more-review-changes
Mar 23, 2026
Merged

test(cache): [Cache Tracing 23] Add missing cache key assertions and use exact equals#5228
adinauer merged 2 commits intofeat/cache-tracingfrom
feat/cache-tracing-more-review-changes

Conversation

@adinauer
Copy link
Member

PR Stack (Cache Tracing)

  • #5172 — Add SentryCacheWrapper and SentryCacheManagerWrapper
  • #5173 — Add enableCacheTracing option
  • #5174 — Add BeanPostProcessor and auto-configuration
  • #5175 — Add cache tracing e2e sample
  • #5179 — Add SentryJCacheWrapper for JCache (JSR-107)
  • #5182 — Add JCache console sample
  • #5183 — Add cache tracing to all Spring Boot 4 samples
  • #5184 — Add retrieve() overrides for reactive/async cache support
  • #5190 — Port cache tracing to Spring Boot 3 Jakarta + samples
  • #5191 — Port cache tracing to Spring Boot 2 + samples
  • #5192 — Skip cache span data when child span is NoOp
  • #5201 — Add db.operation.name attribute to cache spans
  • #5202 — Instrument putIfAbsent, replace, and getAndReplace
  • #5203 — Fix cache hit detection for typed get and fix jcache docs link
  • #5204 — Use method-specific span operations for cache spans
  • #5205 — Merge startSpan helpers into shared core method
  • #5206 — Move operation attribute to centralized CACHE_OPERATION_KEY constant
  • #5207 — Add cache.write boolean span attribute
  • #5208 — Use comma-joined keys as span description for bulk JCache operations
  • #5209 — Remove _KEY suffix from cache SpanDataConvention constants
  • #5210 — Fix get(key, type) double-call in SentryCacheWrapper
  • #5212 — Fix cache evict system test to match actual span op
  • #5213 — Add missing cache key assertions and use exact equals

📜 Description

  • Add missing CACHE_KEY assertions to wrapper tests across all three Spring modules (spring, jakarta, spring-7) for operations that use a key but were not verifying it: get (hit/miss), get-with-type (hit/miss), get-with-callable (hit/miss), retrieve (hit/miss/null), retrieve-with-loader (hit/miss), evict, evictIfPresent
  • Replace Arrays.asList with Collections.singletonList in all four production wrapper files for single-key spans — immutable, no backing array allocation, communicates single-element intent
  • Replace loose contains/containsAll assertions in JCache multi-key tests (getAll, putAll, removeAll) with exact assertEquals checks on both description and CACHE_KEY

⚠️ Merge this PR using a merge commit (not squash). Only the collection branch is squash-merged into main.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 23, 2026

Semver Impact of This PR

🟢 Patch (bug fixes)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


New Features ✨

Spring

  • Cache Tracing by adinauer in #5165
  • [Cache Tracing 3] Add BeanPostProcessor and auto-configuration by adinauer in #5164
  • [Cache Tracing 1] Add SentryCacheWrapper and SentryCacheManagerWrapper by adinauer in #5162
  • [Cache Tracing 1] Add SentryCacheWrapper and SentryCacheManagerWrapper by adinauer in #5137

Other

  • (anr) Profile main thread when ANR and report ANR profiles to Sentry by markushi in #4899
  • (core) [Cache Tracing 2] Add enableCacheTracing option by adinauer in #5163

Bug Fixes 🐛

  • Remove the dependency on protobuf-lite for tombstones by supervacuus in #5157

Internal Changes 🔧

  • (cache) [Cache Tracing 23] Add missing cache key assertions and use exact equals by adinauer in #5228

🤖 This preview updates automatically when you update the PR.

@sentry
Copy link

sentry bot commented Mar 23, 2026

Sentry Build Distribution

App Name App ID Version Configuration Install Page
SDK Size io.sentry.tests.size 8.34.1 (1) release Install Build

Copy link
Collaborator

@lbloder lbloder left a comment

Choose a reason for hiding this comment

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

LGTM 👍

Base automatically changed from fix/cache-tracing-evict-system-test to feat/cache-tracing March 23, 2026 14:26
@adinauer adinauer changed the title test(cache): [Cache Tracing 21] Add missing cache key assertions and use exact equals test(cache): [Cache Tracing 23] Add missing cache key assertions and use exact equals Mar 23, 2026
@adinauer adinauer marked this pull request as ready for review March 23, 2026 14:27
@adinauer adinauer merged commit 3520857 into feat/cache-tracing Mar 23, 2026
9 checks passed
@adinauer adinauer deleted the feat/cache-tracing-more-review-changes branch March 23, 2026 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants