Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't log stack trace in cache tests #11610

Merged
merged 2 commits into from
Nov 21, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public CacheResult<M> getResult(ItemBuilder<M> itemBuilder)
*/
private CacheResult<M> makeRequestAndCache(String cacheKey, ItemBuilder<M> itemBuilder)
throws IOException, InterruptedException, ResponseTooLargeException {
assert !cache.containsKey(cacheKey);
assert !cache.containsKey(cacheKey) : "Cache should not contain key " + cacheKey;

Item<M> item = itemBuilder.buildItem();

Expand Down Expand Up @@ -135,7 +135,7 @@ private CacheResult<M> makeRequestAndCache(String cacheKey, ItemBuilder<M> itemB
return getResultForCacheEntry(cacheKey);
} catch (IOException e) {
logger.log(
Level.WARNING, "Failure storing cache entry; will re-execute without caching: {}", e);
Level.WARNING, "Failure storing cache entry; will re-execute without caching: {}", e.getMessage());
// Re-issue the request since we don't know if we've consumed any of the response.
Item<M> rerequested = itemBuilder.buildItem();
return new CacheResult<>(rerequested.stream(), rerequested.metadata());
Expand Down Expand Up @@ -255,7 +255,7 @@ private void makeRoomFor(long newFileSize) {
toRemove.add(mapEntry);
totalSize -= mapEntry.getValue().size();
}
assert totalSize <= maxTotalCacheSize;
assert totalSize <= maxTotalCacheSize : "totalSize > maxTotalCacheSize (" + totalSize + " > " + maxTotalCacheSize + ")";
removeCacheEntries(toRemove);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ private static long parseMaxFileSizeEnvVar() {
"Unable to parse environment variable "
+ MAX_FILE_SIZE_ENV_VAR
+ ": {}, falling back to default",
e);
e.getMessage());
return DEFAULT_MAX_FILE_SIZE;
}
}
Expand All @@ -92,7 +92,7 @@ private static TotalCacheLimit.Limit parseTotalCacheLimitEnvVar() {
"Unable to parse environment variable "
+ TOTAL_CACHE_SIZE_ENV_VAR
+ ": {}, falling back to default",
e);
e.getMessage());
return new TotalCacheLimit.Percentage(DEFAULT_TOTAL_CACHE_SIZE_FREE_SPACE_PERCENTAGE);
}
}
Expand Down
Loading