5
0
mirror of https://github.com/apache/sqoop.git synced 2025-05-04 01:00:46 +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.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<Data, NullWritable> 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);
}