Skip to content

Commit 9a16bd1

Browse files
committed
change number of partitions during tests
1 parent b98d63f commit 9a16bd1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

python/pyspark/streaming/tests.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
import unittest
2323
import tempfile
2424

25-
from pyspark.context import SparkContext, RDD
25+
from pyspark.context import SparkConf, SparkContext, RDD
2626
from pyspark.streaming.context import StreamingContext
2727

2828

@@ -33,7 +33,8 @@ class PySparkStreamingTestCase(unittest.TestCase):
3333

3434
def setUp(self):
3535
class_name = self.__class__.__name__
36-
self.sc = SparkContext(appName=class_name)
36+
conf = SparkConf().set("spark.default.parallelism", 1)
37+
self.sc = SparkContext(appName=class_name, conf=conf)
3738
self.sc.setCheckpointDir("/tmp")
3839
# TODO: decrease duration to speed up tests
3940
self.ssc = StreamingContext(self.sc, self.duration)

0 commit comments

Comments
 (0)