5
0
mirror of https://github.com/apache/sqoop.git synced 2025-05-04 01:19:38 +08:00

SQOOP-790: Remove flakiness from TestSqoopOutputformatLoadExecutor

(Hari Shreedharan via Jarek Jarcec Cecho)
This commit is contained in:
Jarek Jarcec Cecho 2012-12-18 18:23:58 -08:00
parent b2cc3a26fa
commit 065618b000

View File

@ -33,6 +33,7 @@
import java.util.ConcurrentModificationException; import java.util.ConcurrentModificationException;
import java.util.concurrent.BrokenBarrierException; import java.util.concurrent.BrokenBarrierException;
import java.util.concurrent.TimeUnit;
public class TestSqoopOutputFormatLoadExecutor { public class TestSqoopOutputFormatLoadExecutor {
@ -165,10 +166,8 @@ public void testSuccessfulContinuousLoader() throws Throwable {
writer.close(null); writer.close(null);
} }
@Test @Test (expected = SqoopException.class)
public void testSuccessfulLoader() throws Throwable { public void testSuccessfulLoader() throws Throwable {
conf.set(JobConstants.JOB_TYPE, "EXPORT");
conf.set(JobConstants.JOB_ETL_LOADER, GoodLoader.class.getName());
SqoopOutputFormatLoadExecutor executor = new SqoopOutputFormatLoadExecutor executor = new
SqoopOutputFormatLoadExecutor(true, GoodLoader.class.getName()); SqoopOutputFormatLoadExecutor(true, GoodLoader.class.getName());
RecordWriter<Data, NullWritable> writer = executor.getRecordWriter(); RecordWriter<Data, NullWritable> writer = executor.getRecordWriter();
@ -182,6 +181,8 @@ public void testSuccessfulLoader() throws Throwable {
} }
data.setContent(builder.toString(), Data.CSV_RECORD); data.setContent(builder.toString(), Data.CSV_RECORD);
writer.write(data, null); writer.write(data, null);
//Allow writer to complete.
TimeUnit.SECONDS.sleep(5);
writer.close(null); writer.close(null);
} }