Program: 6790
Project: 6790
Buggy source:
@Test public void testProgramAPI() throws Exception {
  Map<String,String> propMap=Maps.newHashMap();
  propMap.put("String_Node_Str","String_Node_Str");
  File jarFile=createAppJarFile(AppReturnsArgs.class);
  appClient.deploy(Id.Namespace.DEFAULT,jarFile);
  Id.Application app=Id.Application.from(Id.Namespace.DEFAULT,AppReturnsArgs.NAME);
  Id.Service service=Id.Service.from(app,AppReturnsArgs.SERVICE);
  try {
    client.setInstancePreferences(propMap);
    Map<String,String> setMap=Maps.newHashMap();
    setMap.put("String_Node_Str","String_Node_Str");
    programClient.setRuntimeArgs(service,setMap);
    assertEquals(setMap,programClient.getRuntimeArgs(service));
    programClient.start(service,false,ImmutableMap.of("String_Node_Str","String_Node_Str"));
    assertProgramRunning(programClient,service);
    propMap.put("String_Node_Str","String_Node_Str");
    propMap.putAll(setMap);
    URL serviceURL=new URL(serviceClient.getServiceURL(service),AppReturnsArgs.ENDPOINT);
    HttpRequest request=HttpRequest.builder(HttpMethod.GET,serviceURL).build();
    HttpResponse response=HttpRequests.execute(request);
    assertEquals(HttpURLConnection.HTTP_OK,response.getResponseCode());
    assertEquals(GSON.toJson(propMap),response.getResponseBodyAsString());
    programClient.stop(service);
    assertProgramStopped(programClient,service);
    client.deleteInstancePreferences();
    programClient.start(service);
    assertProgramRunning(programClient,service);
    propMap.remove("String_Node_Str");
    propMap.remove("String_Node_Str");
    serviceURL=new URL(serviceClient.getServiceURL(service),AppReturnsArgs.ENDPOINT);
    request=HttpRequest.builder(HttpMethod.GET,serviceURL).build();
    response=HttpRequests.execute(request);
    assertEquals(HttpURLConnection.HTTP_OK,response.getResponseCode());
    assertEquals(GSON.toJson(propMap),response.getResponseBodyAsString());
    programClient.stop(service);
    assertProgramStopped(programClient,service);
    propMap.clear();
    programClient.setRuntimeArgs(service,propMap);
    programClient.start(service);
    assertProgramRunning(programClient,service);
    serviceURL=new URL(serviceClient.getServiceURL(service),AppReturnsArgs.ENDPOINT);
    request=HttpRequest.builder(HttpMethod.GET,serviceURL).build();
    response=HttpRequests.execute(request);
    assertEquals(HttpURLConnection.HTTP_OK,response.getResponseCode());
    assertEquals(GSON.toJson(propMap),response.getResponseBodyAsString());
  }
  finally {
    programClient.stop(service);
    assertProgramStopped(programClient,service);
    appClient.delete(app);
  }
}

Fixed version (ground truth):
@Test public void testProgramAPI() throws Exception {
  Map<String,String> propMap=Maps.newHashMap();
  propMap.put("String_Node_Str","String_Node_Str");
  File jarFile=createAppJarFile(AppReturnsArgs.class);
  appClient.deploy(Id.Namespace.DEFAULT,jarFile);
  Id.Application app=Id.Application.from(Id.Namespace.DEFAULT,AppReturnsArgs.NAME);
  Id.Service service=Id.Service.from(app,AppReturnsArgs.SERVICE);
  try {
    client.setInstancePreferences(propMap);
    Map<String,String> setMap=Maps.newHashMap();
    setMap.put("String_Node_Str","String_Node_Str");
    programClient.setRuntimeArgs(service,setMap);
    assertEquals(setMap,programClient.getRuntimeArgs(service));
    programClient.start(service,false,ImmutableMap.of("String_Node_Str","String_Node_Str"));
    assertProgramRunning(programClient,service);
    propMap.put("String_Node_Str","String_Node_Str");
    propMap.putAll(setMap);
    URL serviceURL=new URL(serviceClient.getServiceURL(service),AppReturnsArgs.ENDPOINT);
    HttpRequest request=HttpRequest.builder(HttpMethod.GET,serviceURL).build();
    HttpResponse response=HttpRequests.execute(request);
    assertEquals(HttpURLConnection.HTTP_OK,response.getResponseCode());
    Map<String,String> responseMap=GSON.fromJson(response.getResponseBodyAsString(),STRING_MAP_TYPE);
    assertEquals(propMap,responseMap);
    programClient.stop(service);
    assertProgramStopped(programClient,service);
    client.deleteInstancePreferences();
    programClient.start(service);
    assertProgramRunning(programClient,service);
    propMap.remove("String_Node_Str");
    propMap.remove("String_Node_Str");
    serviceURL=new URL(serviceClient.getServiceURL(service),AppReturnsArgs.ENDPOINT);
    request=HttpRequest.builder(HttpMethod.GET,serviceURL).build();
    response=HttpRequests.execute(request);
    assertEquals(HttpURLConnection.HTTP_OK,response.getResponseCode());
    responseMap=GSON.fromJson(response.getResponseBodyAsString(),STRING_MAP_TYPE);
    assertEquals(propMap,responseMap);
    programClient.stop(service);
    assertProgramStopped(programClient,service);
    propMap.clear();
    programClient.setRuntimeArgs(service,propMap);
    programClient.start(service);
    assertProgramRunning(programClient,service);
    serviceURL=new URL(serviceClient.getServiceURL(service),AppReturnsArgs.ENDPOINT);
    request=HttpRequest.builder(HttpMethod.GET,serviceURL).build();
    response=HttpRequests.execute(request);
    assertEquals(HttpURLConnection.HTTP_OK,response.getResponseCode());
    responseMap=GSON.fromJson(response.getResponseBodyAsString(),STRING_MAP_TYPE);
    assertEquals(propMap,responseMap);
  }
  finally {
    programClient.stop(service);
    assertProgramStopped(programClient,service);
    appClient.delete(app);
  }
}