From 065618b000ce2662302c9911532aa73ff84bd458 Mon Sep 17 00:00:00 2001 From: Jarek Jarcec Cecho Date: Tue, 18 Dec 2012 18:23:58 -0800 Subject: [PATCH] SQOOP-790: Remove flakiness from TestSqoopOutputformatLoadExecutor (Hari Shreedharan via Jarek Jarcec Cecho) --- .../sqoop/job/mr/TestSqoopOutputFormatLoadExecutor.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/execution/mapreduce/src/test/java/org/apache/sqoop/job/mr/TestSqoopOutputFormatLoadExecutor.java b/execution/mapreduce/src/test/java/org/apache/sqoop/job/mr/TestSqoopOutputFormatLoadExecutor.java index c99b2c0a..1a300aeb 100644 --- a/execution/mapreduce/src/test/java/org/apache/sqoop/job/mr/TestSqoopOutputFormatLoadExecutor.java +++ b/execution/mapreduce/src/test/java/org/apache/sqoop/job/mr/TestSqoopOutputFormatLoadExecutor.java @@ -33,6 +33,7 @@ import java.util.ConcurrentModificationException; import java.util.concurrent.BrokenBarrierException; +import java.util.concurrent.TimeUnit; public class TestSqoopOutputFormatLoadExecutor { @@ -165,10 +166,8 @@ public void testSuccessfulContinuousLoader() throws Throwable { writer.close(null); } - @Test + @Test (expected = SqoopException.class) public void testSuccessfulLoader() throws Throwable { - conf.set(JobConstants.JOB_TYPE, "EXPORT"); - conf.set(JobConstants.JOB_ETL_LOADER, GoodLoader.class.getName()); SqoopOutputFormatLoadExecutor executor = new SqoopOutputFormatLoadExecutor(true, GoodLoader.class.getName()); RecordWriter writer = executor.getRecordWriter(); @@ -182,6 +181,8 @@ public void testSuccessfulLoader() throws Throwable { } data.setContent(builder.toString(), Data.CSV_RECORD); writer.write(data, null); + //Allow writer to complete. + TimeUnit.SECONDS.sleep(5); writer.close(null); }