@Test
public void testDataSkewAndLargeShuffleCombination() throws Exception {

  final List<CompileTimePass> compileTimePasses = new ArrayList<>();
  final Set<RunTimePass<?>> runTimePasses = new HashSet<>();
  compileTimePasses.addAll(DataSkewPolicy.BUILDER.getCompileTimePasses());
  runTimePasses.addAll(DataSkewPolicy.BUILDER.getRunTimePasses());
  compileTimePasses.addAll(LargeShufflePolicy.BUILDER.getCompileTimePasses());
  runTimePasses.addAll(LargeShufflePolicy.BUILDER.getRunTimePasses());
  final Policy combinedPolicy = new PolicyImpl(compileTimePasses, runTimePasses);
  // This should throw an exception.
  // DataSizeMetricCollection is not compatible with Push (All data have to be stored before the data collection).
  expectedException.expect(CompileTimeOptimizationException.class);
  combinedPolicy.runCompileTimeOptimization(dagForSkew, DAG.EMPTY_DAG_DIRECTORY);
}