You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@streams.apache.org by sb...@apache.org on 2014/11/16 01:56:20 UTC

[02/10] incubator-streams git commit: Fixed failing RSS Streams test

Fixed failing RSS Streams test


Project: http://git-wip-us.apache.org/repos/asf/incubator-streams/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-streams/commit/a698a077
Tree: http://git-wip-us.apache.org/repos/asf/incubator-streams/tree/a698a077
Diff: http://git-wip-us.apache.org/repos/asf/incubator-streams/diff/a698a077

Branch: refs/heads/STREAMS-68,218
Commit: a698a077936f187e419f9caaaf024c3c50975ae5
Parents: 76763f8
Author: Ryan Ebanks <ry...@gmail.com>
Authored: Thu Nov 13 08:48:03 2014 -0600
Committer: Ryan Ebanks <ry...@gmail.com>
Committed: Thu Nov 13 08:48:03 2014 -0600

----------------------------------------------------------------------
 .../org/apache/streams/rss/provider/RssStreamProviderTest.java | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-streams/blob/a698a077/streams-contrib/streams-provider-rss/src/test/java/org/apache/streams/rss/provider/RssStreamProviderTest.java
----------------------------------------------------------------------
diff --git a/streams-contrib/streams-provider-rss/src/test/java/org/apache/streams/rss/provider/RssStreamProviderTest.java b/streams-contrib/streams-provider-rss/src/test/java/org/apache/streams/rss/provider/RssStreamProviderTest.java
index bf5e105..1cce391 100644
--- a/streams-contrib/streams-provider-rss/src/test/java/org/apache/streams/rss/provider/RssStreamProviderTest.java
+++ b/streams-contrib/streams-provider-rss/src/test/java/org/apache/streams/rss/provider/RssStreamProviderTest.java
@@ -52,11 +52,15 @@ public class RssStreamProviderTest extends RandomizedTest {
             StreamsResultSet batch = provider.readCurrent();
             LOGGER.debug("Batch size : {}", batch.size());
             datumCount += batch.size();
+            if(batch.size() != 0) { //if race condition happened, pull again
+                batch = provider.readCurrent();
+                assertEquals(0, batch.size());
+            }
 
             assertTrue(provider.scheduler.isComplete());
+            assertEquals(20, datumCount);
             assertFalse(provider.isRunning());
             assertEquals(0, datums.size());
-            assertEquals(20, datumCount);
             provider.cleanUp();
         } finally {
             if(provider != null)