Program: 8014
Project: 8014
Buggy source:
@Test public void testLotsOfAsyncDequeueing() throws Exception {
  TTQueue queue=createQueue();
  long dirtyVersion=getDirtyWriteVersion();
  long startTime=System.currentTimeMillis();
  int numEntries=getNumIterations();
  for (int i=1; i < numEntries + 1; i++) {
    queue.enqueue(new QueueEntry(Bytes.toBytes(i)),dirtyVersion);
  }
  System.out.println("String_Node_Str");
  long enqueueStop=System.currentTimeMillis();
  System.out.println("String_Node_Str" + numEntries + "String_Node_Str"+ (enqueueStop - startTime)+ "String_Node_Str"+ (enqueueStop - startTime) / ((float)numEntries) + "String_Node_Str");
  StatefulQueueConsumer consumerSync=new StatefulQueueConsumer(0,0,1,new QueueConfig(PartitionerType.FIFO,true));
  for (int i=1; i < numEntries + 1; i++) {
    MemoryReadPointer rp=new MemoryReadPointer(timeOracle.getTimestamp());
    DequeueResult result=queue.dequeue(consumerSync,rp);
    assertTrue(result.isSuccess());
    assertTrue(Bytes.equals(Bytes.toBytes(i),result.getEntry().getData()));
    queue.ack(result.getEntryPointer(),consumerSync,rp);
    queue.finalize(result.getEntryPointer(),consumerSync,-1,rp.getWritePointer());
    if (i % 100 == 0)     System.out.print("String_Node_Str");
    if (i % 1000 == 0)     System.out.println("String_Node_Str" + i);
  }
  long dequeueSyncStop=System.currentTimeMillis();
  System.out.println("String_Node_Str" + numEntries + "String_Node_Str"+ (dequeueSyncStop - enqueueStop)+ "String_Node_Str"+ (dequeueSyncStop - enqueueStop) / ((float)numEntries) + "String_Node_Str");
  QueueConfig configAsync=new QueueConfig(PartitionerType.FIFO,false);
  StatefulQueueConsumer consumerAsync=new StatefulQueueConsumer(0,2,1,configAsync);
  for (int i=1; i < numEntries + 1; i++) {
    DequeueResult result=queue.dequeue(consumerAsync,new MemoryReadPointer(timeOracle.getTimestamp()));
    assertTrue(result.isSuccess());
    assertTrue("String_Node_Str" + i + "String_Node_Str"+ Bytes.toInt(result.getEntry().getData()),Bytes.equals(Bytes.toBytes(i),result.getEntry().getData()));
    if (i % 100 == 0)     System.out.print("String_Node_Str");
    if (i % 1000 == 0)     System.out.println("String_Node_Str" + i);
  }
  long dequeueAsyncStop=System.currentTimeMillis();
  System.out.println("String_Node_Str" + numEntries + "String_Node_Str"+ (dequeueAsyncStop - dequeueSyncStop)+ "String_Node_Str"+ (dequeueAsyncStop - dequeueSyncStop) / ((float)numEntries) + "String_Node_Str");
  assertTrue(queue.dequeue(consumerSync,new MemoryReadPointer(timeOracle.getTimestamp())).isEmpty());
  assertTrue(queue.dequeue(consumerAsync,new MemoryReadPointer(timeOracle.getTimestamp())).isEmpty());
}

Fixed version (ground truth):
@Test public void testLotsOfAsyncDequeueing() throws Exception {
  TTQueue queue=createQueue();
  long dirtyVersion=getDirtyWriteVersion();
  long startTime=System.currentTimeMillis();
  int numEntries=getNumIterations();
  for (int i=1; i < numEntries + 1; i++) {
    queue.enqueue(new QueueEntry(Bytes.toBytes(i)),dirtyVersion);
  }
  System.out.println("String_Node_Str");
  long enqueueStop=System.currentTimeMillis();
  System.out.println("String_Node_Str" + numEntries + "String_Node_Str"+ (enqueueStop - startTime)+ "String_Node_Str"+ (enqueueStop - startTime) / ((float)numEntries) + "String_Node_Str");
  StatefulQueueConsumer consumerSync=new StatefulQueueConsumer(0,0,1,new QueueConfig(PartitionerType.FIFO,true));
  for (int i=1; i < numEntries + 1; i++) {
    MemoryReadPointer rp=new MemoryReadPointer(timeOracle.getTimestamp());
    DequeueResult result=queue.dequeue(consumerSync,rp);
    assertTrue(result.isSuccess());
    assertEquals(i,Bytes.toInt(result.getEntry().getData()));
    queue.ack(result.getEntryPointer(),consumerSync,rp);
    queue.finalize(result.getEntryPointer(),consumerSync,-1,rp.getWritePointer());
    if (i % 100 == 0)     System.out.print("String_Node_Str");
    if (i % 1000 == 0)     System.out.println("String_Node_Str" + i);
  }
  long dequeueSyncStop=System.currentTimeMillis();
  System.out.println("String_Node_Str" + numEntries + "String_Node_Str"+ (dequeueSyncStop - enqueueStop)+ "String_Node_Str"+ (dequeueSyncStop - enqueueStop) / ((float)numEntries) + "String_Node_Str");
  QueueConfig configAsync=new QueueConfig(PartitionerType.FIFO,false);
  StatefulQueueConsumer consumerAsync=new StatefulQueueConsumer(0,2,1,configAsync);
  for (int i=1; i < numEntries + 1; i++) {
    DequeueResult result=queue.dequeue(consumerAsync,new MemoryReadPointer(timeOracle.getTimestamp()));
    assertTrue(result.isSuccess());
    assertTrue("String_Node_Str" + i + "String_Node_Str"+ Bytes.toInt(result.getEntry().getData()),Bytes.equals(Bytes.toBytes(i),result.getEntry().getData()));
    if (i % 100 == 0)     System.out.print("String_Node_Str");
    if (i % 1000 == 0)     System.out.println("String_Node_Str" + i);
  }
  long dequeueAsyncStop=System.currentTimeMillis();
  System.out.println("String_Node_Str" + numEntries + "String_Node_Str"+ (dequeueAsyncStop - dequeueSyncStop)+ "String_Node_Str"+ (dequeueAsyncStop - dequeueSyncStop) / ((float)numEntries) + "String_Node_Str");
  assertTrue(queue.dequeue(consumerSync,new MemoryReadPointer(timeOracle.getTimestamp())).isEmpty());
  assertTrue(queue.dequeue(consumerAsync,new MemoryReadPointer(timeOracle.getTimestamp())).isEmpty());
}