Skip to content

Commit e467f59

Browse files
authored
Merge pull request #201 from cloudsufi/fix-race-ut
Force dataset refresh before reads during polling
2 parents 769b221 + f9ede52 commit e467f59

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/test/java/io/cdap/plugin/http/etl/HttpStreamingSourceETLTest.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ public class HttpStreamingSourceETLTest extends HttpSourceETLTest {
5050
private static final Logger LOG = LoggerFactory.getLogger(HttpStreamingSourceETLTest.class);
5151
private static final ArtifactId APP_ARTIFACT_ID = NamespaceId.DEFAULT.artifact("data-streams", "1.0.0");
5252
private static final ArtifactSummary APP_ARTIFACT = new ArtifactSummary("data-streams", "1.0.0");
53-
private static final int WAIT_FOR_RECORDS_TIMEOUT_SECONDS = 60;
54-
private static final long WAIT_FOR_RECORDS_POLLING_INTERVAL_MS = 100;
53+
private static final int WAIT_FOR_RECORDS_TIMEOUT_SECONDS = 120;
54+
private static final long WAIT_FOR_RECORDS_POLLING_INTERVAL_MS = 200;
5555

5656
@BeforeClass
5757
public static void setupTest() throws Exception {
@@ -113,6 +113,7 @@ private List<StructuredRecord> waitForRecords(ProgramManager programManager,
113113
.atMost(WAIT_FOR_RECORDS_TIMEOUT_SECONDS, TimeUnit.SECONDS)
114114
.pollInterval(WAIT_FOR_RECORDS_POLLING_INTERVAL_MS, TimeUnit.MILLISECONDS)
115115
.untilAsserted((() -> {
116+
outputManager.get();
116117
int recordsCount = MockSink.readOutput(outputManager).size();
117118
Assert.assertTrue(
118119
String.format("At least %d records expected, but %d found", exceptedNumberOfRecords, recordsCount),
@@ -122,6 +123,7 @@ private List<StructuredRecord> waitForRecords(ProgramManager programManager,
122123
programManager.stop();
123124
programManager.waitForStopped(10, TimeUnit.SECONDS);
124125

126+
outputManager.get();
125127
return MockSink.readOutput(outputManager);
126128
}
127129

0 commit comments

Comments
 (0)