Program: 5494
Project: 5494
Buggy source:
protected static void initializeAndStartServices(CConfiguration cConf,@Nullable SConfiguration sConf) throws Exception {
  injector=Guice.createInjector(new AppFabricTestModule(cConf,sConf));
  txManager=injector.getInstance(TransactionManager.class);
  txManager.startAndWait();
  dsOpService=injector.getInstance(DatasetOpExecutor.class);
  dsOpService.startAndWait();
  remoteSysOpService=injector.getInstance(RemoteSystemOperationsService.class);
  remoteSysOpService.startAndWait();
  datasetService=injector.getInstance(DatasetService.class);
  datasetService.startAndWait();
  appFabricServer=injector.getInstance(AppFabricServer.class);
  appFabricServer.startAndWait();
  DiscoveryServiceClient discoveryClient=injector.getInstance(DiscoveryServiceClient.class);
  ServiceDiscovered appFabricHttpDiscovered=discoveryClient.discover(Constants.Service.APP_FABRIC_HTTP);
  EndpointStrategy endpointStrategy=new RandomEndpointStrategy(appFabricHttpDiscovered);
  port=endpointStrategy.pick(1,TimeUnit.SECONDS).getSocketAddress().getPort();
  txClient=injector.getInstance(TransactionSystemClient.class);
  metricsCollectionService=injector.getInstance(MetricsCollectionService.class);
  metricsCollectionService.startAndWait();
  metricsService=injector.getInstance(MetricsQueryService.class);
  metricsService.startAndWait();
  streamService=injector.getInstance(StreamService.class);
  streamService.startAndWait();
  serviceStore=injector.getInstance(ServiceStore.class);
  serviceStore.startAndWait();
  metadataService=injector.getInstance(MetadataService.class);
  metadataService.startAndWait();
  locationFactory=getInjector().getInstance(LocationFactory.class);
  streamClient=new StreamClient(getClientConfig(discoveryClient,Constants.Service.STREAMS));
  streamViewClient=new StreamViewClient(getClientConfig(discoveryClient,Constants.Service.STREAMS));
  datasetClient=new DatasetClient(getClientConfig(discoveryClient,Constants.Service.DATASET_MANAGER));
  createNamespaces();
}

Fixed version (ground truth):
protected static void initializeAndStartServices(CConfiguration cConf,@Nullable SConfiguration sConf) throws Exception {
  injector=Guice.createInjector(Modules.override(new AppFabricTestModule(cConf,sConf)).with(new AbstractModule(){
    @Override protected void configure(){
      bind(UGIProvider.class).to(CurrentUGIProvider.class);
    }
  }
));
  txManager=injector.getInstance(TransactionManager.class);
  txManager.startAndWait();
  dsOpService=injector.getInstance(DatasetOpExecutor.class);
  dsOpService.startAndWait();
  remoteSysOpService=injector.getInstance(RemoteSystemOperationsService.class);
  remoteSysOpService.startAndWait();
  datasetService=injector.getInstance(DatasetService.class);
  datasetService.startAndWait();
  appFabricServer=injector.getInstance(AppFabricServer.class);
  appFabricServer.startAndWait();
  DiscoveryServiceClient discoveryClient=injector.getInstance(DiscoveryServiceClient.class);
  ServiceDiscovered appFabricHttpDiscovered=discoveryClient.discover(Constants.Service.APP_FABRIC_HTTP);
  EndpointStrategy endpointStrategy=new RandomEndpointStrategy(appFabricHttpDiscovered);
  port=endpointStrategy.pick(1,TimeUnit.SECONDS).getSocketAddress().getPort();
  txClient=injector.getInstance(TransactionSystemClient.class);
  metricsCollectionService=injector.getInstance(MetricsCollectionService.class);
  metricsCollectionService.startAndWait();
  metricsService=injector.getInstance(MetricsQueryService.class);
  metricsService.startAndWait();
  streamService=injector.getInstance(StreamService.class);
  streamService.startAndWait();
  serviceStore=injector.getInstance(ServiceStore.class);
  serviceStore.startAndWait();
  metadataService=injector.getInstance(MetadataService.class);
  metadataService.startAndWait();
  locationFactory=getInjector().getInstance(LocationFactory.class);
  createNamespaces();
}