(t *testing.T)
| 152 | } |
| 153 | |
| 154 | func TestLRUCache_GetMultiWithError_PropagatesError(t *testing.T) { |
| 155 | backendErr := errors.New("backend error") |
| 156 | backend := NewErroringMockCache(backendErr) |
| 157 | |
| 158 | reg := prometheus.NewPedanticRegistry() |
| 159 | lru, err := WrapWithLRUCache(backend, "test", reg, 10000, 2*time.Hour, log.NewNopLogger()) |
| 160 | require.NoError(t, err) |
| 161 | |
| 162 | // Key not in LRU, so it will fetch from backend which returns an error |
| 163 | result, err := lru.GetMultiWithError(context.Background(), []string{"missing"}) |
| 164 | require.Empty(t, result) |
| 165 | require.ErrorIs(t, err, backendErr) |
| 166 | } |
nothing calls this directly
no test coverage detected