SQOOP-790: Remove flakiness from TestSqoopOutputformatLoadExecutor (Hari Shreedharan via Jarek Jarcec Cecho)
Project: http://git-wip-us.apache.org/repos/asf/sqoop/repo Commit: http://git-wip-us.apache.org/repos/asf/sqoop/commit/065618b0 Tree: http://git-wip-us.apache.org/repos/asf/sqoop/tree/065618b0 Diff: http://git-wip-us.apache.org/repos/asf/sqoop/diff/065618b0 Branch: refs/heads/branch-1.99.1 Commit: 065618b000ce2662302c9911532aa73ff84bd458 Parents: b2cc3a2 Author: Jarek Jarcec Cecho <[email protected]> Authored: Tue Dec 18 18:23:58 2012 -0800 Committer: Jarek Jarcec Cecho <[email protected]> Committed: Tue Dec 18 18:28:47 2012 -0800 ---------------------------------------------------------------------- .../job/mr/TestSqoopOutputFormatLoadExecutor.java | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/sqoop/blob/065618b0/execution/mapreduce/src/test/java/org/apache/sqoop/job/mr/TestSqoopOutputFormatLoadExecutor.java ---------------------------------------------------------------------- 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 c99b2c0..1a300ae 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 org.junit.Test; import java.util.ConcurrentModificationException; import java.util.concurrent.BrokenBarrierException; +import java.util.concurrent.TimeUnit; public class TestSqoopOutputFormatLoadExecutor { @@ -165,10 +166,8 @@ public class TestSqoopOutputFormatLoadExecutor { 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<Data, NullWritable> writer = executor.getRecordWriter(); @@ -182,6 +181,8 @@ public class TestSqoopOutputFormatLoadExecutor { } data.setContent(builder.toString(), Data.CSV_RECORD); writer.write(data, null); + //Allow writer to complete. + TimeUnit.SECONDS.sleep(5); writer.close(null); }
