Skip to content

Commit

Permalink
fix: Fix flakiness in JSON test
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben Creech committed Aug 10, 2022
1 parent 85b3ebd commit 2c00924
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
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 @@ -377,7 +378,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 2c00924

Please sign in to comment.