Skip to content

Commit

Permalink
Fixed pep8 check. Added delay to test_batch_info_reports
Browse files Browse the repository at this point in the history
  • Loading branch information
djalova committed Oct 23, 2015
1 parent 0ac3df6 commit 233104d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 0 additions & 1 deletion python/pyspark/streaming/listener.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ def __init__(self, javaBatchInfo):

self.outputOperationInfos = self._map2dict(javaBatchInfo.outputOperationInfos())


def schedulingDelay(self):
"""
Time taken for the first job of this batch to start processing from the time this batch
Expand Down
5 changes: 5 additions & 0 deletions python/pyspark/streaming/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,8 @@ def func(dstream):

class StreamingListenerTests(PySparkStreamingTestCase):

duration = .5

class BatchInfoCollector(StreamingListener):

def __init__(self):
Expand Down Expand Up @@ -428,6 +430,9 @@ def func(dstream):
expected = [[1], [2], [3], [4]]
self._test_func(input, func, expected)

# Test occasionally fails without a delay
time.sleep(.1)

batchInfosSubmitted = batch_collector.batchInfosSubmitted
self.assertEqual(len(batchInfosSubmitted), 4)

Expand Down

0 comments on commit 233104d

Please sign in to comment.