Program: 5716
Project: 5716
Buggy source:
@Test public void testTextFileSink() throws Exception {
  String inputName="String_Node_Str";
  String outputName="String_Node_Str";
  ETLStage source=new ETLStage("String_Node_Str",MockSource.getPlugin(inputName));
  Map<String,String> sinkProperties=new HashMap<>();
  sinkProperties.put(TextFileSetSink.Conf.FILESET_NAME,outputName);
  sinkProperties.put(TextFileSetSink.Conf.FIELD_SEPARATOR,"String_Node_Str");
  ETLStage sink=new ETLStage("String_Node_Str",new ETLPlugin(TextFileSetSink.NAME,BatchSink.PLUGIN_TYPE,sinkProperties,null));
  ETLBatchConfig pipelineConfig=ETLBatchConfig.builder("String_Node_Str").addStage(source).addStage(sink).addConnection(source.getName(),sink.getName()).build();
  Id.Application pipelineId=Id.Application.from(Id.Namespace.DEFAULT,"String_Node_Str");
  ApplicationManager appManager=deployApplication(pipelineId,new AppRequest<>(APP_ARTIFACT,pipelineConfig));
  Schema inputSchema=Schema.recordOf("String_Node_Str",Schema.Field.of("String_Node_Str",Schema.of(Schema.Type.STRING)),Schema.Field.of("String_Node_Str",Schema.of(Schema.Type.STRING)));
  Map<String,String> users=new HashMap<>();
  users.put("String_Node_Str","String_Node_Str");
  users.put("String_Node_Str","String_Node_Str");
  users.put("String_Node_Str","String_Node_Str");
  List<StructuredRecord> inputRecords=new ArrayList<>();
  for (  Map.Entry<String,String> userEntry : users.entrySet()) {
    String name=userEntry.getKey();
    String item=userEntry.getValue();
    inputRecords.add(StructuredRecord.builder(inputSchema).set("String_Node_Str",name).set("String_Node_Str",item).build());
  }
  DataSetManager<Table> inputManager=getDataset(inputName);
  MockSource.writeInput(inputManager,inputRecords);
  Map<String,String> runtimeArgs=new HashMap<>();
  String outputPath="String_Node_Str";
  runtimeArgs.put(String.format("String_Node_Str",outputName),outputPath);
  WorkflowManager workflowManager=appManager.getWorkflowManager(SmartWorkflow.NAME);
  workflowManager.start(runtimeArgs);
  workflowManager.waitForFinish(4,TimeUnit.MINUTES);
  DataSetManager<FileSet> outputManager=getDataset(outputName);
  FileSet output=outputManager.get();
  Location outputDir=output.getBaseLocation().append(outputPath);
  Map<String,String> actual=new HashMap<>();
  for (  Location outputFile : outputDir.list()) {
    if (outputFile.getName().endsWith("String_Node_Str") || "String_Node_Str".equals(outputFile.getName())) {
      continue;
    }
    try (BufferedReader reader=new BufferedReader(new InputStreamReader(outputFile.getInputStream()))){
      String line;
      while ((line=reader.readLine()) != null) {
        String[] parts=line.split("String_Node_Str");
        actual.put(parts[0],parts[1]);
      }
    }
   }
  Assert.assertEquals(actual,users);
}

Fixed version (ground truth):
@Test public void testTextFileSink() throws Exception {
  String inputName="String_Node_Str";
  String outputName="String_Node_Str";
  ETLStage source=new ETLStage("String_Node_Str",MockSource.getPlugin(inputName));
  Map<String,String> sinkProperties=new HashMap<>();
  sinkProperties.put(TextFileSetSink.Conf.FILESET_NAME,outputName);
  sinkProperties.put(TextFileSetSink.Conf.FIELD_SEPARATOR,"String_Node_Str");
  ETLStage sink=new ETLStage("String_Node_Str",new ETLPlugin(TextFileSetSink.NAME,BatchSink.PLUGIN_TYPE,sinkProperties,null));
  ETLBatchConfig pipelineConfig=ETLBatchConfig.builder("String_Node_Str").addStage(source).addStage(sink).addConnection(source.getName(),sink.getName()).build();
  ApplicationId pipelineId=NamespaceId.DEFAULT.app("String_Node_Str");
  ApplicationManager appManager=deployApplication(pipelineId,new AppRequest<>(APP_ARTIFACT,pipelineConfig));
  Schema inputSchema=Schema.recordOf("String_Node_Str",Schema.Field.of("String_Node_Str",Schema.of(Schema.Type.STRING)),Schema.Field.of("String_Node_Str",Schema.of(Schema.Type.STRING)));
  Map<String,String> users=new HashMap<>();
  users.put("String_Node_Str","String_Node_Str");
  users.put("String_Node_Str","String_Node_Str");
  users.put("String_Node_Str","String_Node_Str");
  List<StructuredRecord> inputRecords=new ArrayList<>();
  for (  Map.Entry<String,String> userEntry : users.entrySet()) {
    String name=userEntry.getKey();
    String item=userEntry.getValue();
    inputRecords.add(StructuredRecord.builder(inputSchema).set("String_Node_Str",name).set("String_Node_Str",item).build());
  }
  DataSetManager<Table> inputManager=getDataset(inputName);
  MockSource.writeInput(inputManager,inputRecords);
  Map<String,String> runtimeArgs=new HashMap<>();
  String outputPath="String_Node_Str";
  runtimeArgs.put(String.format("String_Node_Str",outputName),outputPath);
  WorkflowManager workflowManager=appManager.getWorkflowManager(SmartWorkflow.NAME);
  workflowManager.start(runtimeArgs);
  workflowManager.waitForFinish(4,TimeUnit.MINUTES);
  DataSetManager<FileSet> outputManager=getDataset(outputName);
  FileSet output=outputManager.get();
  Location outputDir=output.getBaseLocation().append(outputPath);
  Map<String,String> actual=new HashMap<>();
  for (  Location outputFile : outputDir.list()) {
    if (outputFile.getName().endsWith("String_Node_Str") || "String_Node_Str".equals(outputFile.getName())) {
      continue;
    }
    try (BufferedReader reader=new BufferedReader(new InputStreamReader(outputFile.getInputStream()))){
      String line;
      while ((line=reader.readLine()) != null) {
        String[] parts=line.split("String_Node_Str");
        actual.put(parts[0],parts[1]);
      }
    }
   }
  Assert.assertEquals(actual,users);
}