From 233104d8cfc761eeaa9b3c21808f21209cbdac93 Mon Sep 17 00:00:00 2001 From: Daniel Jalova Date: Fri, 23 Oct 2015 16:10:24 -0700 Subject: [PATCH] Fixed pep8 check. Added delay to test_batch_info_reports --- python/pyspark/streaming/listener.py | 1 - python/pyspark/streaming/tests.py | 5 +++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/python/pyspark/streaming/listener.py b/python/pyspark/streaming/listener.py index 69a2fb7b3124b..221767bf85a79 100644 --- a/python/pyspark/streaming/listener.py +++ b/python/pyspark/streaming/listener.py @@ -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 diff --git a/python/pyspark/streaming/tests.py b/python/pyspark/streaming/tests.py index cd8aba989a19c..fc76c6ea2300f 100644 --- a/python/pyspark/streaming/tests.py +++ b/python/pyspark/streaming/tests.py @@ -401,6 +401,8 @@ def func(dstream): class StreamingListenerTests(PySparkStreamingTestCase): + duration = .5 + class BatchInfoCollector(StreamingListener): def __init__(self): @@ -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)