-
Notifications
You must be signed in to change notification settings - Fork 831
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
bugfix: add newline in stdout exporter #6848
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #6848 +/- ##
============================================
- Coverage 90.49% 90.49% -0.01%
- Complexity 6599 6600 +1
============================================
Files 731 731
Lines 19738 19742 +4
Branches 1938 1938
============================================
+ Hits 17862 17865 +3
Misses 1285 1285
- Partials 591 592 +1 ☔ View full report in Codecov by Sentry. |
@@ -1115,7 +1115,9 @@ private static void assertMatches(String expected, String actual) { | |||
*/ | |||
private static String toPattern(String expected) { | |||
Map<String, String> replacePatterns = new HashMap<>(); | |||
replacePatterns.put("timestamp", "[0-9]+(\\.[0-9]+)?"); | |||
String timestampPattern = "[0-9]+(\\.[0-9]+)?"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is fixing a flaky test, because nanos are omitted if 0
@jack-berg can you take a look? |
@@ -38,6 +38,14 @@ public final void writeJsonTo(JsonGenerator output) throws IOException { | |||
} | |||
} | |||
|
|||
/** Marshals into the {@link JsonGenerator} in proto JSON format and adds a newline. */ | |||
public final void writeJsonWithNewline(JsonGenerator output) throws IOException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this code call output.writeRaw('\n')
or should StreamJsonWriter
? Seems like an implementation detail of StreamJsonWriter
to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried calling from StreamJsonWriter, but this method closes the generator, so it fails
fixes #6836