Program: 93023
Project: 93023
Buggy source:
@Test public void testSyncLoggingHandler() throws InterruptedException {
  String logName=formatForTest("String_Node_Str");
  LoggingOptions options=logging().getOptions();
  MonitoredResource resource=MonitoredResource.of("String_Node_Str",ImmutableMap.of("String_Node_Str",options.getProjectId(),"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  LoggingHandler handler=new LoggingHandler(logName,options,resource);
  handler.setLevel(Level.WARNING);
  handler.setSynchronicity(Synchronicity.SYNC);
  Logger logger=Logger.getLogger(getClass().getName());
  logger.addHandler(handler);
  logger.setLevel(Level.WARNING);
  logger.warning("String_Node_Str");
  Iterator<LogEntry> iterator=logging().listLogEntries(EntryListOption.filter("String_Node_Str" + logName)).iterateAll().iterator();
  while (!iterator.hasNext()) {
    Thread.sleep(500L);
    iterator=logging().listLogEntries(EntryListOption.filter("String_Node_Str" + logName)).iterateAll().iterator();
  }
  assertTrue(iterator.hasNext());
  LogEntry entry=iterator.next();
  assertTrue(entry.getPayload() instanceof StringPayload);
  assertTrue(entry.<StringPayload>getPayload().getData().contains("String_Node_Str"));
  assertEquals(logName,entry.getLogName());
  assertEquals(ImmutableMap.of("String_Node_Str","String_Node_Str","String_Node_Str",String.valueOf(Level.WARNING.intValue())),entry.getLabels());
  assertEquals(resource,entry.getResource());
  assertNull(entry.getHttpRequest());
  assertEquals(Severity.WARNING,entry.getSeverity());
  assertNull(entry.getOperation());
  assertNotNull(entry.getInsertId());
  assertNotNull(entry.getTimestamp());
  assertFalse(iterator.hasNext());
  logger.removeHandler(handler);
  logging().deleteLog(logName);
}

Fixed version (ground truth):
@Test public void testSyncLoggingHandler() throws InterruptedException {
  String logId=formatForTest("String_Node_Str");
  LoggingOptions options=logging().getOptions();
  LogName logName=LogName.create(options.getProjectId(),logId);
  MonitoredResource resource=MonitoredResource.of("String_Node_Str",ImmutableMap.of("String_Node_Str",options.getProjectId(),"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  LoggingHandler handler=new LoggingHandler(logId,options,resource);
  handler.setLevel(Level.WARNING);
  handler.setSynchronicity(Synchronicity.SYNC);
  Logger logger=Logger.getLogger(getClass().getName());
  logger.addHandler(handler);
  logger.setLevel(Level.WARNING);
  logger.warning("String_Node_Str");
  String filter=createEqualityFilter("String_Node_Str",logName);
  Iterator<LogEntry> iterator=logging().listLogEntries(EntryListOption.filter(filter)).iterateAll().iterator();
  while (!iterator.hasNext()) {
    Thread.sleep(500L);
    iterator=logging().listLogEntries(EntryListOption.filter(filter)).iterateAll().iterator();
  }
  assertTrue(iterator.hasNext());
  LogEntry entry=iterator.next();
  assertTrue(entry.getPayload() instanceof StringPayload);
  assertTrue(entry.<StringPayload>getPayload().getData().contains("String_Node_Str"));
  assertEquals(logId,entry.getLogName());
  assertEquals(ImmutableMap.of("String_Node_Str","String_Node_Str","String_Node_Str",String.valueOf(Level.WARNING.intValue())),entry.getLabels());
  assertEquals(resource,entry.getResource());
  assertNull(entry.getHttpRequest());
  assertEquals(Severity.WARNING,entry.getSeverity());
  assertNull(entry.getOperation());
  assertNotNull(entry.getInsertId());
  assertNotNull(entry.getTimestamp());
  assertFalse(iterator.hasNext());
  logger.removeHandler(handler);
  logging().deleteLog(logId);
}