@Test
public void testFailingDataSinkTask() {

	int keyCnt = 100;
	int valCnt = 20;
	super.initEnvironment(MEMORY_MANAGER_SIZE, NETWORK_BUFFER_SIZE);
	super.addInput(new UniformRecordGenerator(keyCnt, valCnt, false), 0);
	DataSinkTask<Record> testTask = new DataSinkTask<>();
	Configuration stubParams = new Configuration();
	super.getTaskConfig().setStubParameters(stubParams);
	super.registerFileOutputTask(testTask, MockFailingOutputFormat.class, new File(tempTestPath).toURI().toString());
	boolean stubFailed = false;
	try {
		testTask.invoke();
	} catch (Exception e) {
		stubFailed = true;
	}
	Assert.assertTrue("Function exception was not forwarded.", stubFailed);
	// assert that temp file was removed
	File tempTestFile = new File(this.tempTestPath);
	Assert.assertFalse("Temp output file has not been removed", tempTestFile.exists());
}