Skip to content

Commit

Permalink
fix: Fix flakiness in JSON test (#1006)
Browse files Browse the repository at this point in the history
* fix: Fix flakiness in JSON test

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

Co-authored-by: Ben Creech <[email protected]>
Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
3 people committed Aug 18, 2022
1 parent 49bf5b4 commit cafafe4
Showing 1 changed file with 5 additions and 1 deletion.
Expand Up @@ -25,6 +25,7 @@
import com.google.cloud.logging.Payload.ProtoPayload;
import com.google.cloud.logging.Payload.StringPayload;
import com.google.common.collect.ImmutableMap;
import com.google.gson.JsonParser;
import com.google.protobuf.Any;
import com.google.protobuf.Empty;
import java.time.Instant;
Expand Down Expand Up @@ -380,7 +381,10 @@ private void compareLogEntry(LogEntry expected, LogEntry value, Boolean extraVal
public void testStructureLogPresentations() {
for (int i = 0; i < TEST_LOG_ENTRIES.length; i++) {
String structured_log = TEST_LOG_ENTRIES[i].toStructuredJsonString();
assertEquals(EXPECTED_STRUCTURED_LOGS[i], structured_log);

assertEquals(
JsonParser.parseString(EXPECTED_STRUCTURED_LOGS[i]),
JsonParser.parseString(structured_log));
}
}

Expand Down

0 comments on commit cafafe4

Please sign in to comment.