-
Notifications
You must be signed in to change notification settings - Fork 630
feat(client-v2, jdbc-v2): improve logging coverage on error/diagnostic paths #2972
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
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
c01d6dd
feat(client-v2,jdbc-v2): improve logging coverage on error/diagnostic…
polyglotAI-bot f79801a
fix(client-v2): clear SonarCloud reliability/maintainability findings…
polyglotAI-bot 2f6e164
Address review (@chernser): scope error logging, restore switch + ret…
polyglotAI-bot d9d0eda
Address review (@chernser): reduce comments on the new logging code
polyglotAI-bot 32e6f65
refactor(client-v2): extract shared retry-attempt WARN helper
polyglotAI-bot fdaa70a
test(client-v2): cover logServerErrorResponse null-safety and excepti…
polyglotAI-bot 4bad5aa
Address review (@chernser): scope out retry-logging, string-concat ex…
polyglotAI-bot 88372e8
Merge remote-tracking branch 'origin/main' into polyglot/jdbc-v2-clie…
polyglotAI-bot 5913f7d
test(jdbc-v2): cover writer cleanup buffer-close failure paths
polyglotAI-bot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
...t-v2/src/test/java/com/clickhouse/client/api/data_formats/internal/ProcessParserTest.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| package com.clickhouse.client.api.data_formats.internal; | ||
|
|
||
| import org.testng.annotations.Test; | ||
|
|
||
| import java.util.Map; | ||
|
|
||
| import static org.testng.Assert.assertEquals; | ||
| import static org.testng.Assert.assertFalse; | ||
| import static org.testng.Assert.assertTrue; | ||
|
|
||
| public class ProcessParserTest { | ||
|
|
||
| /** | ||
| * A non-numeric summary value must be skipped (and logged at DEBUG) while the remaining numeric | ||
| * fields still parse: a single malformed field must not drop the rest of the summary. | ||
| */ | ||
| @Test | ||
| public void testParseSkipsNonNumericValuesAndKeepsTheRest() { | ||
| Map<String, Long> parsed = ProcessParser.parse( | ||
| "{\"read_rows\":\"100\",\"bogus\":\"not_a_number\",\"read_bytes\":\"2048\"}"); | ||
|
|
||
| assertEquals(parsed.get("read_rows"), Long.valueOf(100L), | ||
| "a numeric field before the bad one must parse"); | ||
| assertEquals(parsed.get("read_bytes"), Long.valueOf(2048L), | ||
| "a numeric field after the bad one must still parse"); | ||
| assertFalse(parsed.containsKey("bogus"), | ||
| "the non-numeric field must be skipped, not stored"); | ||
| } | ||
|
|
||
| @Test | ||
| public void testParseReadsAllNumericFields() { | ||
| Map<String, Long> parsed = ProcessParser.parse("{\"read_rows\":\"7\",\"written_rows\":\"3\"}"); | ||
| assertEquals(parsed.get("read_rows"), Long.valueOf(7L)); | ||
| assertEquals(parsed.get("written_rows"), Long.valueOf(3L)); | ||
| } | ||
|
|
||
| @Test | ||
| public void testParseEmptyObjectReturnsEmptyMap() { | ||
| assertTrue(ProcessParser.parse("{}").isEmpty(), | ||
| "an empty summary object must yield an empty map"); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.