Skip to content

Commit 1d96791

Browse files
committed
Update StreamingContextSuite tests.
1 parent e6482fa commit 1d96791

1 file changed

Lines changed: 10 additions & 9 deletions

File tree

streaming/src/test/scala/org/apache/spark/streaming/StreamingContextSuite.scala

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,9 @@ class StreamingContextSuite extends SparkFunSuite with BeforeAndAfter with Timeo
8282
test("from conf with settings") {
8383
val myConf = SparkContext.updatedConf(new SparkConf(false), master, appName)
8484
// TODO(josh): Update these exmaples to use a different configuration.
85-
myConf.set("spark.cleaner.ttl", "10s")
85+
myConf.set("spark.cleaner.periodicGC.interval", "10s")
8686
ssc = new StreamingContext(myConf, batchDuration)
87-
assert(ssc.conf.getTimeAsSeconds("spark.cleaner.ttl", "-1") === 10)
87+
assert(ssc.conf.getTimeAsSeconds("spark.cleaner.periodicGC.interval", "-1") === 10)
8888
}
8989

9090
test("from existing SparkContext") {
@@ -94,26 +94,27 @@ class StreamingContextSuite extends SparkFunSuite with BeforeAndAfter with Timeo
9494

9595
test("from existing SparkContext with settings") {
9696
val myConf = SparkContext.updatedConf(new SparkConf(false), master, appName)
97-
myConf.set("spark.cleaner.ttl", "10s")
97+
myConf.set("spark.cleaner.periodicGC.interval", "10s")
9898
ssc = new StreamingContext(myConf, batchDuration)
99-
assert(ssc.conf.getTimeAsSeconds("spark.cleaner.ttl", "-1") === 10)
99+
assert(ssc.conf.getTimeAsSeconds("spark.cleaner.periodicGC.interval", "-1") === 10)
100100
}
101101

102102
test("from checkpoint") {
103103
val myConf = SparkContext.updatedConf(new SparkConf(false), master, appName)
104-
myConf.set("spark.cleaner.ttl", "10s")
104+
myConf.set("spark.cleaner.periodicGC.interval", "10s")
105105
val ssc1 = new StreamingContext(myConf, batchDuration)
106106
addInputStream(ssc1).register()
107107
ssc1.start()
108108
val cp = new Checkpoint(ssc1, Time(1000))
109109
assert(
110110
Utils.timeStringAsSeconds(cp.sparkConfPairs
111-
.toMap.getOrElse("spark.cleaner.ttl", "-1")) === 10)
111+
.toMap.getOrElse("spark.cleaner.periodicGC.interval", "-1")) === 10)
112112
ssc1.stop()
113113
val newCp = Utils.deserialize[Checkpoint](Utils.serialize(cp))
114-
assert(newCp.createSparkConf().getTimeAsSeconds("spark.cleaner.ttl", "-1") === 10)
114+
assert(
115+
newCp.createSparkConf().getTimeAsSeconds("spark.cleaner.periodicGC.interval", "-1") === 10)
115116
ssc = new StreamingContext(null, newCp, null)
116-
assert(ssc.conf.getTimeAsSeconds("spark.cleaner.ttl", "-1") === 10)
117+
assert(ssc.conf.getTimeAsSeconds("spark.cleaner.periodicGC.interval", "-1") === 10)
117118
}
118119

119120
test("checkPoint from conf") {
@@ -289,7 +290,7 @@ class StreamingContextSuite extends SparkFunSuite with BeforeAndAfter with Timeo
289290

290291
test("stop gracefully") {
291292
val conf = new SparkConf().setMaster(master).setAppName(appName)
292-
conf.set("spark.cleaner.ttl", "3600s")
293+
conf.set("spark.cleaner.periodicGC.interval", "3600s")
293294
sc = new SparkContext(conf)
294295
for (i <- 1 to 4) {
295296
logInfo("==================================\n\n\n")

0 commit comments

Comments
 (0)