Commit a05c2c4
test: avoid pool pollution in TestSnapshotSlicesAreIndependent
Acquire + Release with RecordMutationEvent / RecordCacheOperationError
leaves the pool holding a collector whose mutationEvents and
cacheOpErrors slices are non-nil empty (NewCacheAnalyticsCollector
leaves them nil; only ResetForReuse'd writes make them non-nil).
Downstream tests that assert.Equal a full CacheAnalyticsSnapshot with
those fields set to nil then pick up the polluted collector and fail.
Use NewCacheAnalyticsCollector directly — the test's purpose is to
prove Snapshot's slice independence, which does not require exercising
the sync.Pool path.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 5596ef0 commit a05c2c4
1 file changed
Lines changed: 6 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2045 | 2045 | | |
2046 | 2046 | | |
2047 | 2047 | | |
2048 | | - | |
2049 | | - | |
| 2048 | + | |
| 2049 | + | |
| 2050 | + | |
| 2051 | + | |
| 2052 | + | |
| 2053 | + | |
2050 | 2054 | | |
2051 | 2055 | | |
2052 | 2056 | | |
| |||
0 commit comments