Program: 160283
Project: 160283
Buggy source:
private void testChangeTrackerBackoff(final CustomizableMockHttpClient mockHttpClient) throws Throwable {
  URL testURL=getReplicationURL();
  final CountDownLatch changeTrackerFinishedSignal=new CountDownLatch(1);
  ChangeTrackerClient client=new ChangeTrackerClient(){
    @Override public String getUserAgent(){
      return manager.getUserAgent();
    }
    @Override public void changeTrackerStopped(    ChangeTracker tracker){
      Log.v(TAG,"String_Node_Str");
      changeTrackerFinishedSignal.countDown();
    }
    @Override public void changeTrackerFinished(    ChangeTracker tracker){
      Log.v(TAG,"String_Node_Str");
    }
    @Override public void changeTrackerCaughtUp(){
    }
    @Override public void changeTrackerReceivedChange(    Map<String,Object> change){
      Object seq=change.get("String_Node_Str");
      Log.v(TAG,"String_Node_Str" + seq.toString());
    }
    @Override public HttpClient getHttpClient(){
      return mockHttpClient;
    }
  }
;
  final ChangeTracker changeTracker=new ChangeTracker(testURL,ChangeTracker.ChangeTrackerMode.LongPoll,false,0,client);
  changeTracker.setUsePOST(isTestingAgainstSyncGateway());
  changeTracker.start();
  Thread.sleep(5 * 1000);
  assertTrue(mockHttpClient.getCapturedRequests().size() < 25);
  mockHttpClient.clearResponders();
  mockHttpClient.addResponderReturnEmptyChangesFeed();
  Thread.sleep(3 * 1000);
  int before=mockHttpClient.getCapturedRequests().size();
  Thread.sleep(2 * 1000);
  int after=mockHttpClient.getCapturedRequests().size();
  assertTrue(changeTracker.backoff.getNumAttempts() == 0);
  changeTracker.stop();
  try {
    boolean success=changeTrackerFinishedSignal.await(300,TimeUnit.SECONDS);
    assertTrue(success);
  }
 catch (  InterruptedException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
private void testChangeTrackerBackoff(final CustomizableMockHttpClient mockHttpClient) throws Throwable {
  URL testURL=getReplicationURL();
  final CountDownLatch changeTrackerFinishedSignal=new CountDownLatch(1);
  ChangeTrackerClient client=new ChangeTrackerClient(){
    @Override public void changeTrackerStopped(    ChangeTracker tracker){
      Log.v(TAG,"String_Node_Str");
      changeTrackerFinishedSignal.countDown();
    }
    @Override public void changeTrackerFinished(    ChangeTracker tracker){
      Log.v(TAG,"String_Node_Str");
    }
    @Override public void changeTrackerCaughtUp(){
    }
    @Override public void changeTrackerReceivedChange(    Map<String,Object> change){
      Object seq=change.get("String_Node_Str");
      Log.v(TAG,"String_Node_Str" + seq.toString());
    }
    @Override public HttpClient getHttpClient(){
      return mockHttpClient;
    }
  }
;
  final ChangeTracker changeTracker=new ChangeTracker(testURL,ChangeTracker.ChangeTrackerMode.LongPoll,false,0,client);
  changeTracker.setUsePOST(isTestingAgainstSyncGateway());
  changeTracker.start();
  Thread.sleep(5 * 1000);
  assertTrue(mockHttpClient.getCapturedRequests().size() < 25);
  mockHttpClient.clearResponders();
  mockHttpClient.addResponderReturnEmptyChangesFeed();
  Thread.sleep(3 * 1000);
  int before=mockHttpClient.getCapturedRequests().size();
  Thread.sleep(2 * 1000);
  int after=mockHttpClient.getCapturedRequests().size();
  assertTrue(changeTracker.backoff.getNumAttempts() == 0);
  changeTracker.stop();
  try {
    boolean success=changeTrackerFinishedSignal.await(300,TimeUnit.SECONDS);
    assertTrue(success);
  }
 catch (  InterruptedException e) {
    e.printStackTrace();
  }
}