Program: 6932
Project: 6932
Buggy source:
@Before public void before() throws Exception {
  File dataDir=new File(tmpFolder.newFolder(),"String_Node_Str");
  cConf.set(Constants.CFG_LOCAL_DATA_DIR,dataDir.getAbsolutePath());
  cConf.set(Constants.Dataset.Manager.ADDRESS,"String_Node_Str");
  cConf.setBoolean(Constants.Dangerous.UNRECOVERABLE_RESET,true);
  InMemoryDiscoveryService discoveryService=new InMemoryDiscoveryService();
  MetricsCollectionService metricsCollectionService=new NoOpMetricsCollectionService();
  Configuration txConf=HBaseConfiguration.create();
  CConfigurationUtil.copyTxProperties(cConf,txConf);
  txManager=new TransactionManager(txConf);
  txManager.startAndWait();
  InMemoryTxSystemClient txSystemClient=new InMemoryTxSystemClient(txManager);
  locationFactory=new LocalLocationFactory(new File(cConf.get(Constants.CFG_LOCAL_DATA_DIR)));
  NamespacedLocationFactory namespacedLocationFactory=new DefaultNamespacedLocationFactory(cConf,locationFactory);
  framework=new RemoteDatasetFramework(discoveryService,registryFactory,new LocalDatasetTypeClassLoaderFactory());
  ImmutableSet<HttpHandler> handlers=ImmutableSet.<HttpHandler>of(new DatasetAdminOpHTTPHandler(new NoAuthenticator(),framework));
  opExecutorService=new DatasetOpExecutorService(cConf,discoveryService,metricsCollectionService,handlers);
  opExecutorService.startAndWait();
  ImmutableMap<String,DatasetModule> modules=ImmutableMap.<String,DatasetModule>builder().put("String_Node_Str",new InMemoryTableModule()).put("String_Node_Str",new CoreDatasetsModule()).putAll(DatasetMetaTableUtil.getModules()).build();
  InMemoryDatasetFramework mdsFramework=new InMemoryDatasetFramework(registryFactory,modules,cConf);
  MDSDatasetsRegistry mdsDatasetsRegistry=new MDSDatasetsRegistry(txSystemClient,mdsFramework);
  ExploreFacade exploreFacade=new ExploreFacade(new DiscoveryExploreClient(discoveryService),cConf);
  service=new DatasetService(cConf,namespacedLocationFactory,discoveryService,discoveryService,new DatasetTypeManager(cConf,mdsDatasetsRegistry,locationFactory,DEFAULT_MODULES),new DatasetInstanceManager(mdsDatasetsRegistry),metricsCollectionService,new InMemoryDatasetOpExecutor(framework),mdsDatasetsRegistry,exploreFacade,new HashSet<DatasetMetricsReporter>(),new LocalUnderlyingSystemNamespaceAdmin(cConf,namespacedLocationFactory,exploreFacade),new UsageRegistry(txExecutorFactory,framework));
  service.start();
  final CountDownLatch startLatch=new CountDownLatch(1);
  discoveryService.discover(Constants.Service.DATASET_MANAGER).watchChanges(new ServiceDiscovered.ChangeListener(){
    @Override public void onChange(    ServiceDiscovered serviceDiscovered){
      if (!Iterables.isEmpty(serviceDiscovered)) {
        startLatch.countDown();
      }
    }
  }
,Threads.SAME_THREAD_EXECUTOR);
  startLatch.await(5,TimeUnit.SECONDS);
  framework.createNamespace(Constants.SYSTEM_NAMESPACE_ID);
  framework.createNamespace(NAMESPACE_ID);
}

Fixed version (ground truth):
@Before public void before() throws Exception {
  File dataDir=new File(tmpFolder.newFolder(),"String_Node_Str");
  cConf.set(Constants.CFG_LOCAL_DATA_DIR,dataDir.getAbsolutePath());
  cConf.set(Constants.Dataset.Manager.ADDRESS,"String_Node_Str");
  cConf.setBoolean(Constants.Dangerous.UNRECOVERABLE_RESET,true);
  InMemoryDiscoveryService discoveryService=new InMemoryDiscoveryService();
  MetricsCollectionService metricsCollectionService=new NoOpMetricsCollectionService();
  Configuration txConf=HBaseConfiguration.create();
  CConfigurationUtil.copyTxProperties(cConf,txConf);
  txManager=new TransactionManager(txConf);
  txManager.startAndWait();
  InMemoryTxSystemClient txSystemClient=new InMemoryTxSystemClient(txManager);
  LocalLocationFactory locationFactory=new LocalLocationFactory(new File(cConf.get(Constants.CFG_LOCAL_DATA_DIR)));
  NamespacedLocationFactory namespacedLocationFactory=new DefaultNamespacedLocationFactory(cConf,locationFactory);
  framework=new RemoteDatasetFramework(discoveryService,registryFactory,new LocalDatasetTypeClassLoaderFactory());
  ImmutableSet<HttpHandler> handlers=ImmutableSet.<HttpHandler>of(new DatasetAdminOpHTTPHandler(new NoAuthenticator(),framework));
  opExecutorService=new DatasetOpExecutorService(cConf,discoveryService,metricsCollectionService,handlers);
  opExecutorService.startAndWait();
  ImmutableMap<String,DatasetModule> modules=ImmutableMap.<String,DatasetModule>builder().put("String_Node_Str",new InMemoryTableModule()).put("String_Node_Str",new CoreDatasetsModule()).putAll(DatasetMetaTableUtil.getModules()).build();
  InMemoryDatasetFramework mdsFramework=new InMemoryDatasetFramework(registryFactory,modules,cConf);
  MDSDatasetsRegistry mdsDatasetsRegistry=new MDSDatasetsRegistry(txSystemClient,mdsFramework);
  ExploreFacade exploreFacade=new ExploreFacade(new DiscoveryExploreClient(discoveryService),cConf);
  service=new DatasetService(cConf,namespacedLocationFactory,discoveryService,discoveryService,new DatasetTypeManager(cConf,mdsDatasetsRegistry,locationFactory,DEFAULT_MODULES),new DatasetInstanceManager(mdsDatasetsRegistry),metricsCollectionService,new InMemoryDatasetOpExecutor(framework),mdsDatasetsRegistry,exploreFacade,new HashSet<DatasetMetricsReporter>(),new LocalStorageProviderNamespaceAdmin(cConf,namespacedLocationFactory,exploreFacade),new UsageRegistry(txExecutorFactory,framework));
  service.start();
  final CountDownLatch startLatch=new CountDownLatch(1);
  discoveryService.discover(Constants.Service.DATASET_MANAGER).watchChanges(new ServiceDiscovered.ChangeListener(){
    @Override public void onChange(    ServiceDiscovered serviceDiscovered){
      if (!Iterables.isEmpty(serviceDiscovered)) {
        startLatch.countDown();
      }
    }
  }
,Threads.SAME_THREAD_EXECUTOR);
  startLatch.await(5,TimeUnit.SECONDS);
  framework.createNamespace(Constants.SYSTEM_NAMESPACE_ID);
  framework.createNamespace(NAMESPACE_ID);
}