Program: 13150
Project: 13150
Buggy source:
@Test public void testSelectFromFooSchemaWithRequestHeaders() throws Exception {
  execute(requestWithSchema("String_Node_Str","String_Node_Str"));
  ensureYellow();
  waitNoPendingTasksOnAll();
  execute(requestWithSchema("String_Node_Str","String_Node_Str"));
  assertThat(getTableCount("String_Node_Str","String_Node_Str"),is(1L));
  assertThat(getTableCount("String_Node_Str","String_Node_Str"),is(0L));
  execute(requestWithSchema("String_Node_Str","String_Node_Str"));
  execute(requestWithSchema("String_Node_Str","String_Node_Str"));
  execute(requestWithSchema("String_Node_Str","String_Node_Str"));
  assertThat(response.rowCount(),is(2L));
  execute(requestWithSchema("String_Node_Str","String_Node_Str"));
  assertThat(response.rowCount(),is(2L));
  File foobarExport=tmpFolder.newFolder("String_Node_Str");
  execute(requestWithSchema("String_Node_Str","String_Node_Str",foobarExport.getAbsolutePath()));
  refresh();
  execute(requestWithSchema("String_Node_Str","String_Node_Str"));
  refresh();
  execute(requestWithSchema("String_Node_Str","String_Node_Str"));
  assertThat(response.rowCount(),is(0L));
  execute(requestWithSchema("String_Node_Str","String_Node_Str",foobarExport.getAbsolutePath() + "String_Node_Str"));
  execute(requestWithSchema("String_Node_Str","String_Node_Str"));
  execute(requestWithSchema("String_Node_Str","String_Node_Str"));
  assertThat(response.rowCount(),is(2L));
  execute(requestWithSchema("String_Node_Str","String_Node_Str"));
  execute(requestWithSchema("String_Node_Str","String_Node_Str"));
  execute(requestWithSchema("String_Node_Str","String_Node_Str"));
  assertThat(response.rowCount(),is(4L));
  execute(requestWithSchema("String_Node_Str","String_Node_Str"));
  assertThat(getTableCount("String_Node_Str","String_Node_Str"),is(0L));
}

Fixed version (ground truth):
@Test public void testSelectFromFooSchemaWithRequestHeaders() throws Exception {
  execute(requestWithSchema("String_Node_Str","String_Node_Str"));
  ensureYellow();
  waitNoPendingTasksOnAll();
  execute(requestWithSchema("String_Node_Str","String_Node_Str"));
  assertThat(getTableCount("String_Node_Str","String_Node_Str"),is(1L));
  assertThat(getTableCount("String_Node_Str","String_Node_Str"),is(0L));
  execute(requestWithSchema("String_Node_Str","String_Node_Str"));
  execute(requestWithSchema("String_Node_Str","String_Node_Str"));
  execute(requestWithSchema("String_Node_Str","String_Node_Str"));
  assertThat(response.rowCount(),is(2L));
  execute(requestWithSchema("String_Node_Str","String_Node_Str"));
  assertThat(response.rowCount(),is(2L));
  File foobarExport=tmpFolder.newFolder("String_Node_Str");
  String uriTemplate=Paths.get(foobarExport.toURI()).toUri().toString();
  execute(requestWithSchema("String_Node_Str","String_Node_Str",uriTemplate));
  refresh();
  execute(requestWithSchema("String_Node_Str","String_Node_Str"));
  refresh();
  execute(requestWithSchema("String_Node_Str","String_Node_Str"));
  assertThat(response.rowCount(),is(0L));
  execute(requestWithSchema("String_Node_Str","String_Node_Str",uriTemplate + "String_Node_Str"));
  execute(requestWithSchema("String_Node_Str","String_Node_Str"));
  execute(requestWithSchema("String_Node_Str","String_Node_Str"));
  assertThat(response.rowCount(),is(2L));
  execute(requestWithSchema("String_Node_Str","String_Node_Str"));
  execute(requestWithSchema("String_Node_Str","String_Node_Str"));
  execute(requestWithSchema("String_Node_Str","String_Node_Str"));
  assertThat(response.rowCount(),is(4L));
  execute(requestWithSchema("String_Node_Str","String_Node_Str"));
  assertThat(getTableCount("String_Node_Str","String_Node_Str"),is(0L));
}