Program: 130730
Project: 130730
Buggy source:
@Test public void testSnapshotCluster() throws Exception {
  final int nTxns=20;
  QuorumTestCallback cb1=new QuorumTestCallback();
  SnapshotStateMachine st1=new SnapshotStateMachine(nTxns);
  QuorumTestCallback cb2=new QuorumTestCallback();
  SnapshotStateMachine st2=new SnapshotStateMachine(nTxns);
  String server1=getUniqueHostPort();
  String server2=getUniqueHostPort();
  Properties prop1=new Properties();
  prop1.setProperty("String_Node_Str","String_Node_Str");
  prop1.setProperty("String_Node_Str",server1);
  prop1.setProperty("String_Node_Str",getDirectory().getPath() + File.separator + server1);
  Properties prop2=new Properties();
  prop2.setProperty("String_Node_Str","String_Node_Str");
  prop2.setProperty("String_Node_Str",server2);
  prop2.setProperty("String_Node_Str",getDirectory().getPath() + File.separator + server2);
  Zab zab1=new Zab(st1,prop1,server1);
  st1.waitMemberChanged();
  Zab zab2=new Zab(st2,prop2,server1);
  st2.waitMemberChanged();
  st1.waitMemberChanged();
  for (int i=0; i < nTxns; ++i) {
    zab1.send(ByteBuffer.wrap(("String_Node_Str" + i).getBytes()));
    Thread.sleep(50);
  }
  st1.txnsCount.await();
  st2.txnsCount.await();
  zab1.shutdown();
  zab2.shutdown();
  SnapshotStateMachine stNew1=new SnapshotStateMachine(nTxns);
  SnapshotStateMachine stNew2=new SnapshotStateMachine(nTxns);
  prop1=new Properties();
  prop1.setProperty("String_Node_Str",getDirectory().getPath() + File.separator + server1);
  prop2=new Properties();
  prop2.setProperty("String_Node_Str",getDirectory().getPath() + File.separator + server2);
  zab1=new Zab(stNew1,prop1);
  zab2=new Zab(stNew2,prop2);
  stNew1.waitMemberChanged();
  stNew2.waitMemberChanged();
  Assert.assertEquals(st1.state,stNew1.state);
  Assert.assertEquals(st2.state,stNew2.state);
  Assert.assertEquals(stNew1.state,stNew2.state);
  zab1.shutdown();
  zab2.shutdown();
}

Fixed version (ground truth):
@Test(timeout=30000) public void testSnapshotCluster() throws Exception {
  final int nTxns=20;
  QuorumTestCallback cb1=new QuorumTestCallback();
  SnapshotStateMachine st1=new SnapshotStateMachine(nTxns);
  QuorumTestCallback cb2=new QuorumTestCallback();
  SnapshotStateMachine st2=new SnapshotStateMachine(nTxns);
  String server1=getUniqueHostPort();
  String server2=getUniqueHostPort();
  Properties prop1=new Properties();
  prop1.setProperty("String_Node_Str","String_Node_Str");
  prop1.setProperty("String_Node_Str",server1);
  prop1.setProperty("String_Node_Str",getDirectory().getPath() + File.separator + server1);
  Properties prop2=new Properties();
  prop2.setProperty("String_Node_Str","String_Node_Str");
  prop2.setProperty("String_Node_Str",server2);
  prop2.setProperty("String_Node_Str",getDirectory().getPath() + File.separator + server2);
  Zab zab1=new Zab(st1,prop1,server1);
  st1.waitMemberChanged();
  Zab zab2=new Zab(st2,prop2,server1);
  st2.waitMemberChanged();
  st1.waitMemberChanged();
  for (int i=0; i < nTxns; ++i) {
    zab1.send(ByteBuffer.wrap(("String_Node_Str" + i).getBytes()));
    Thread.sleep(50);
  }
  st1.txnsCount.await();
  st2.txnsCount.await();
  zab1.shutdown();
  zab2.shutdown();
  SnapshotStateMachine stNew1=new SnapshotStateMachine(nTxns);
  SnapshotStateMachine stNew2=new SnapshotStateMachine(nTxns);
  prop1=new Properties();
  prop1.setProperty("String_Node_Str",getDirectory().getPath() + File.separator + server1);
  prop2=new Properties();
  prop2.setProperty("String_Node_Str",getDirectory().getPath() + File.separator + server2);
  zab1=new Zab(stNew1,prop1);
  zab2=new Zab(stNew2,prop2);
  stNew1.waitMemberChanged();
  stNew2.waitMemberChanged();
  Assert.assertEquals(st1.state,stNew1.state);
  Assert.assertEquals(st2.state,stNew2.state);
  Assert.assertEquals(stNew1.state,stNew2.state);
  zab1.shutdown();
  zab2.shutdown();
}