Program: 134969
Project: 134969
Buggy source:
/** 
 * Logs a single record and waits for it to come back from the Log service  and to pass the queue (which is set to zero delay). Then the record is verified, and the same test is repeated a couple of times with different log records. 
 * @throws Exception
 */
public void testLogQueueNoDelay() throws Exception {
  LogConfig logConfig=ClientLogManager.getAcsLogManager().getLogConfig();
  assertTrue("String_Node_Str",logConfig.getDefaultMinLogLevel() == 2);
  logReceiver.setDelayMillis(0);
  BlockingQueue<DelayedLogEntry> queue=logReceiver.getLogQueue();
  final int numLogs=5;
  Level[] levels=new Level[]{Level.FINEST,Level.FINE,Level.INFO,Level.WARNING,Level.SEVERE};
  Random random=new Random(System.currentTimeMillis());
  for (int i=0; i < numLogs; i++) {
    Level level=levels[random.nextInt(levels.length)];
    String acsLevelName=AcsLogLevel.getNativeLevel(level).getEntryName();
    int jlogLevelIndex=LogTypeHelper.parseLogTypeDescription(acsLevelName).intValue();
    String logMessage="String_Node_Str" + i;
    m_logger.log(level,logMessage);
    long timeoutSec=10L + logConfig.getFlushPeriodSeconds();
    while (true) {
      DelayedLogEntry delayedLogEntry=queue.poll(timeoutSec,TimeUnit.SECONDS);
      if (delayedLogEntry != null) {
        if (delayedLogEntry.isQueuePoison()) {
          fail("String_Node_Str");
        }
        ILogEntry logEntry=delayedLogEntry.getLogEntry();
        String sourceObjectName=(String)logEntry.getField(ILogEntry.FIELD_SOURCEOBJECT);
        if (sourceObjectName != null && sourceObjectName.equals("String_Node_Str")) {
          assertEquals(logMessage,logEntry.getField(ILogEntry.FIELD_LOGMESSAGE));
          assertEquals(jlogLevelIndex,((Integer)logEntry.getField(ILogEntry.FIELD_ENTRYTYPE)).intValue());
          System.out.println("String_Node_Str" + i);
          break;
        }
 else {
          System.out.println("String_Node_Str" + sourceObjectName);
        }
      }
 else {
        fail("String_Node_Str" + i + "String_Node_Str"+ timeoutSec+ "String_Node_Str");
      }
    }
  }
  logReceiver.stop();
}

Fixed version (ground truth):
/** 
 * Logs a single record and waits for it to come back from the Log service  and to pass the queue (which is set to zero delay). Then the record is verified, and the same test is repeated a couple of times with different log records. 
 * @throws Exception
 */
public void testLogQueueNoDelay() throws Exception {
  LogConfig logConfig=ClientLogManager.getAcsLogManager().getLogConfig();
  assertTrue("String_Node_Str",logConfig.getDefaultMinLogLevel() == 2);
  logReceiver.setDelayMillis(0);
  BlockingQueue<DelayedLogEntry> queue=logReceiver.getLogQueue();
  final int numLogs=5;
  Level[] levels=new Level[]{Level.FINEST,Level.FINE,Level.INFO,Level.WARNING,Level.SEVERE};
  Random random=new Random(System.currentTimeMillis());
  for (int i=0; i < numLogs; i++) {
    Level level=levels[random.nextInt(levels.length)];
    String acsLevelName=AcsLogLevel.getNativeLevel(level).getEntryName();
    int jlogLevelIndex=LogTypeHelper.parseLogTypeDescription(acsLevelName).intValue();
    String logMessage="String_Node_Str" + i;
    m_logger.log(level,logMessage);
    long timeoutSec=10L + logConfig.getFlushPeriodSeconds();
    while (true) {
      DelayedLogEntry delayedLogEntry=queue.poll(timeoutSec,TimeUnit.SECONDS);
      if (delayedLogEntry != null) {
        if (delayedLogEntry.isQueuePoison()) {
          fail("String_Node_Str");
        }
        ILogEntry logEntry=delayedLogEntry.getLogEntry();
        String sourceObjectName=(String)logEntry.getField(ILogEntry.Field.SOURCEOBJECT);
        if (sourceObjectName != null && sourceObjectName.equals("String_Node_Str")) {
          assertEquals(logMessage,logEntry.getField(ILogEntry.Field.LOGMESSAGE));
          assertEquals(jlogLevelIndex,((Integer)logEntry.getField(ILogEntry.Field.ENTRYTYPE)).intValue());
          System.out.println("String_Node_Str" + i);
          break;
        }
 else {
          System.out.println("String_Node_Str" + sourceObjectName);
        }
      }
 else {
        fail("String_Node_Str" + i + "String_Node_Str"+ timeoutSec+ "String_Node_Str");
      }
    }
  }
  logReceiver.stop();
}