Program: 55595
Project: 55595
Buggy source:
@Test public void testSyncTasksDistribution() throws IllegalStateException, InterruptedException {
  logIn(client1,"String_Node_Str","String_Node_Str");
  logIn(client2,"String_Node_Str","String_Node_Str");
  client1.openNewMatch("String_Node_Str",4,new MapInfoPacket("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str",4),34L,null,null,null);
  Thread.sleep(150);
  assertEquals(EPlayerState.IN_MATCH,client1.getState());
  MatchInfoPacket matchInfo=client1.getMatchInfo();
  client2.joinMatch(matchInfo.getId(),null,null,null);
  Thread.sleep(50);
  assertEquals(EPlayerState.IN_MATCH,client2.getState());
  client1.setReadyState(true);
  client2.setReadyState(true);
  Thread.sleep(30);
  client2.startMatch();
  Thread.sleep(30 + NetworkConstants.Client.LOCKSTEP_PERIOD);
  assertEquals(EPlayerState.IN_RUNNING_MATCH,client1.getState());
  assertEquals(EPlayerState.IN_RUNNING_MATCH,client2.getState());
  Thread.sleep(2 * NetworkConstants.Client.LOCKSTEP_PERIOD);
  assertEquals(NetworkConstants.Client.LOCKSTEP_DEFAULT_LEAD_STEPS,clock1.getAllowedLockstep());
  assertEquals(NetworkConstants.Client.LOCKSTEP_DEFAULT_LEAD_STEPS,clock2.getAllowedLockstep());
  Thread.sleep((2 + NetworkConstants.Client.LOCKSTEP_DEFAULT_LEAD_STEPS) * NetworkConstants.Client.LOCKSTEP_PERIOD);
  assertEquals(NetworkConstants.Client.LOCKSTEP_DEFAULT_LEAD_STEPS,clock1.getAllowedLockstep());
  assertEquals(NetworkConstants.Client.LOCKSTEP_DEFAULT_LEAD_STEPS,clock2.getAllowedLockstep());
  TestTaskPacket testTask=new TestTaskPacket("String_Node_Str",2342,(byte)-23);
  client2.scheduleTask(testTask);
  Thread.sleep(2 * NetworkConstants.Client.TIME_SYNC_SEND_INTERVALL);
  assertEquals(0,clock1.popBufferedTasks().size());
  assertEquals(0,clock2.popBufferedTasks().size());
  clock1.setTime(NetworkConstants.Client.LOCKSTEP_PERIOD + NetworkConstants.Client.TIME_SYNC_TOLERATED_DIFFERENCE + 10);
  Thread.sleep(NetworkConstants.Client.TIME_SYNC_SEND_INTERVALL + 40);
  List<TaskPacket> packets1=clock1.popBufferedTasks();
  assertEquals(1,packets1.size());
  assertEquals(testTask,packets1.get(0));
  List<TaskPacket> packets2=clock2.popBufferedTasks();
  assertEquals(1,packets2.size());
  assertEquals(testTask,packets2.get(0));
  Thread.sleep(2 * NetworkConstants.Client.LOCKSTEP_PERIOD);
  assertEquals(NetworkConstants.Client.LOCKSTEP_DEFAULT_LEAD_STEPS + 1,clock1.getAllowedLockstep());
  assertEquals(NetworkConstants.Client.LOCKSTEP_DEFAULT_LEAD_STEPS + 1,clock2.getAllowedLockstep());
}

Fixed version (ground truth):
@Test public void testSyncTasksDistribution() throws IllegalStateException, InterruptedException {
  logIn(client1,"String_Node_Str","String_Node_Str");
  logIn(client2,"String_Node_Str","String_Node_Str");
  client1.openNewMatch("String_Node_Str",4,new MapInfoPacket("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str",4),34L,null,null,null);
  Thread.sleep(150L);
  assertEquals(EPlayerState.IN_MATCH,client1.getState());
  MatchInfoPacket matchInfo=client1.getMatchInfo();
  client2.joinMatch(matchInfo.getId(),null,null,null);
  Thread.sleep(50L);
  assertEquals(EPlayerState.IN_MATCH,client2.getState());
  client1.setReadyState(true);
  client2.setReadyState(true);
  Thread.sleep(30L);
  client2.startMatch();
  Thread.sleep(30 + NetworkConstants.Client.LOCKSTEP_PERIOD);
  assertEquals(EPlayerState.IN_RUNNING_MATCH,client1.getState());
  assertEquals(EPlayerState.IN_RUNNING_MATCH,client2.getState());
  Thread.sleep(2 * NetworkConstants.Client.LOCKSTEP_PERIOD);
  assertEquals(NetworkConstants.Client.LOCKSTEP_DEFAULT_LEAD_STEPS,clock1.getAllowedLockstep());
  assertEquals(NetworkConstants.Client.LOCKSTEP_DEFAULT_LEAD_STEPS,clock2.getAllowedLockstep());
  Thread.sleep((2 + NetworkConstants.Client.LOCKSTEP_DEFAULT_LEAD_STEPS) * NetworkConstants.Client.LOCKSTEP_PERIOD);
  assertEquals(NetworkConstants.Client.LOCKSTEP_DEFAULT_LEAD_STEPS,clock1.getAllowedLockstep());
  assertEquals(NetworkConstants.Client.LOCKSTEP_DEFAULT_LEAD_STEPS,clock2.getAllowedLockstep());
  TestTaskPacket testTask=new TestTaskPacket("String_Node_Str",2342,(byte)-23);
  client2.scheduleTask(testTask);
  Thread.sleep(2L * NetworkConstants.Client.TIME_SYNC_SEND_INTERVALL);
  assertEquals(0,clock1.popBufferedTasks().size());
  assertEquals(0,clock2.popBufferedTasks().size());
  clock1.setTime(NetworkConstants.Client.LOCKSTEP_PERIOD + NetworkConstants.Client.TIME_SYNC_TOLERATED_DIFFERENCE + 10);
  Thread.sleep(NetworkConstants.Client.TIME_SYNC_SEND_INTERVALL + 40L);
  List<TaskPacket> packets1=clock1.popBufferedTasks();
  assertEquals(1,packets1.size());
  assertEquals(testTask,packets1.get(0));
  List<TaskPacket> packets2=clock2.popBufferedTasks();
  assertEquals(1,packets2.size());
  assertEquals(testTask,packets2.get(0));
  Thread.sleep(2 * NetworkConstants.Client.LOCKSTEP_PERIOD);
  assertEquals(NetworkConstants.Client.LOCKSTEP_DEFAULT_LEAD_STEPS + 1,clock1.getAllowedLockstep());
  assertEquals(NetworkConstants.Client.LOCKSTEP_DEFAULT_LEAD_STEPS + 1,clock2.getAllowedLockstep());
}