Program: 6933
Project: 6933
Buggy source:
@Before public void before() throws Exception {
  CConfiguration cConf=CConfiguration.create();
  File dataDir=new File(tmpFolder.newFolder(),"String_Node_Str");
  cConf.set(Constants.CFG_LOCAL_DATA_DIR,dataDir.getAbsolutePath());
  if (!DirUtils.mkdirs(dataDir)) {
    throw new RuntimeException(String.format("String_Node_Str",dataDir));
  }
  cConf.set(Constants.Dataset.Manager.OUTPUT_DIR,dataDir.getAbsolutePath());
  cConf.set(Constants.Dataset.Manager.ADDRESS,"String_Node_Str");
  cConf.setBoolean(Constants.Dangerous.UNRECOVERABLE_RESET,true);
  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);
  final Injector injector=Guice.createInjector(new ConfigModule(cConf),new LocationRuntimeModule().getInMemoryModules(),new SystemDatasetRuntimeModule().getInMemoryModules(),new TransactionInMemoryModule());
  DatasetDefinitionRegistryFactory registryFactory=new DatasetDefinitionRegistryFactory(){
    @Override public DatasetDefinitionRegistry create(){
      DefaultDatasetDefinitionRegistry registry=new DefaultDatasetDefinitionRegistry();
      injector.injectMembers(registry);
      return registry;
    }
  }
;
  locationFactory=injector.getInstance(LocationFactory.class);
  NamespacedLocationFactory namespacedLocationFactory=injector.getInstance(NamespacedLocationFactory.class);
  dsFramework=new RemoteDatasetFramework(discoveryService,registryFactory,new LocalDatasetTypeClassLoaderFactory());
  ImmutableSet<HttpHandler> handlers=ImmutableSet.<HttpHandler>of(new DatasetAdminOpHTTPHandler(new NoAuthenticator(),dsFramework));
  opExecutorService=new DatasetOpExecutorService(cConf,discoveryService,metricsCollectionService,handlers);
  opExecutorService.startAndWait();
  ImmutableMap<String,DatasetModule> modules=ImmutableMap.<String,DatasetModule>builder().putAll(injector.getInstance(Key.get(new TypeLiteral<Map<String,DatasetModule>>(){
  }
,Names.named("String_Node_Str")))).putAll(DatasetMetaTableUtil.getModules()).build();
  TransactionExecutorFactory txExecutorFactory=injector.getInstance(TransactionExecutorFactory.class);
  MDSDatasetsRegistry mdsDatasetsRegistry=new MDSDatasetsRegistry(txSystemClient,new InMemoryDatasetFramework(registryFactory,modules,cConf));
  ExploreFacade exploreFacade=new ExploreFacade(new DiscoveryExploreClient(discoveryService),cConf);
  service=new DatasetService(cConf,namespacedLocationFactory,discoveryService,discoveryService,new DatasetTypeManager(cConf,mdsDatasetsRegistry,locationFactory,Collections.<String,DatasetModule>emptyMap()),new DatasetInstanceManager(mdsDatasetsRegistry),metricsCollectionService,new InMemoryDatasetOpExecutor(dsFramework),mdsDatasetsRegistry,exploreFacade,new HashSet<DatasetMetricsReporter>(),new LocalUnderlyingSystemNamespaceAdmin(cConf,namespacedLocationFactory,exploreFacade),new UsageRegistry(txExecutorFactory,dsFramework));
  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);
  Locations.mkdirsIfNotExists(namespacedLocationFactory.get(Constants.DEFAULT_NAMESPACE_ID));
}

Fixed version (ground truth):
@Before public void before() throws Exception {
  CConfiguration cConf=CConfiguration.create();
  File dataDir=new File(tmpFolder.newFolder(),"String_Node_Str");
  cConf.set(Constants.CFG_LOCAL_DATA_DIR,dataDir.getAbsolutePath());
  if (!DirUtils.mkdirs(dataDir)) {
    throw new RuntimeException(String.format("String_Node_Str",dataDir));
  }
  cConf.set(Constants.Dataset.Manager.OUTPUT_DIR,dataDir.getAbsolutePath());
  cConf.set(Constants.Dataset.Manager.ADDRESS,"String_Node_Str");
  cConf.setBoolean(Constants.Dangerous.UNRECOVERABLE_RESET,true);
  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);
  final Injector injector=Guice.createInjector(new ConfigModule(cConf),new LocationRuntimeModule().getInMemoryModules(),new SystemDatasetRuntimeModule().getInMemoryModules(),new TransactionInMemoryModule());
  DatasetDefinitionRegistryFactory registryFactory=new DatasetDefinitionRegistryFactory(){
    @Override public DatasetDefinitionRegistry create(){
      DefaultDatasetDefinitionRegistry registry=new DefaultDatasetDefinitionRegistry();
      injector.injectMembers(registry);
      return registry;
    }
  }
;
  locationFactory=injector.getInstance(LocationFactory.class);
  NamespacedLocationFactory namespacedLocationFactory=injector.getInstance(NamespacedLocationFactory.class);
  dsFramework=new RemoteDatasetFramework(discoveryService,registryFactory,new LocalDatasetTypeClassLoaderFactory());
  ImmutableSet<HttpHandler> handlers=ImmutableSet.<HttpHandler>of(new DatasetAdminOpHTTPHandler(new NoAuthenticator(),dsFramework));
  opExecutorService=new DatasetOpExecutorService(cConf,discoveryService,metricsCollectionService,handlers);
  opExecutorService.startAndWait();
  ImmutableMap<String,DatasetModule> modules=ImmutableMap.<String,DatasetModule>builder().putAll(injector.getInstance(Key.get(new TypeLiteral<Map<String,DatasetModule>>(){
  }
,Names.named("String_Node_Str")))).putAll(DatasetMetaTableUtil.getModules()).build();
  TransactionExecutorFactory txExecutorFactory=injector.getInstance(TransactionExecutorFactory.class);
  MDSDatasetsRegistry mdsDatasetsRegistry=new MDSDatasetsRegistry(txSystemClient,new InMemoryDatasetFramework(registryFactory,modules,cConf));
  ExploreFacade exploreFacade=new ExploreFacade(new DiscoveryExploreClient(discoveryService),cConf);
  service=new DatasetService(cConf,namespacedLocationFactory,discoveryService,discoveryService,new DatasetTypeManager(cConf,mdsDatasetsRegistry,locationFactory,Collections.<String,DatasetModule>emptyMap()),new DatasetInstanceManager(mdsDatasetsRegistry),metricsCollectionService,new InMemoryDatasetOpExecutor(dsFramework),mdsDatasetsRegistry,exploreFacade,new HashSet<DatasetMetricsReporter>(),new LocalStorageProviderNamespaceAdmin(cConf,namespacedLocationFactory,exploreFacade),new UsageRegistry(txExecutorFactory,dsFramework));
  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);
  Locations.mkdirsIfNotExists(namespacedLocationFactory.get(Constants.DEFAULT_NAMESPACE_ID));
}