Github user vanzin commented on a diff in the pull request: https://github.com/apache/spark/pull/21430#discussion_r190993327 --- Diff: streaming/src/test/scala/org/apache/spark/streaming/ReceivedBlockTrackerSuite.scala --- @@ -308,12 +354,16 @@ class ReceivedBlockTrackerSuite * want to control time by manually incrementing it to test log clean. */ def createTracker( + createSpyTracker: Boolean = false, setCheckpointDir: Boolean = true, recoverFromWriteAheadLog: Boolean = false, clock: Clock = new SystemClock): ReceivedBlockTracker = { val cpDirOption = if (setCheckpointDir) Some(checkpointDirectory.toString) else None - val tracker = new ReceivedBlockTracker( + var tracker = new ReceivedBlockTracker( conf, hadoopConf, Seq(streamId), clock, recoverFromWriteAheadLog, cpDirOption) + if (createSpyTracker) { + tracker = spy(tracker) --- End diff -- Why not do this in the caller? Less code and cleaner.
--- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org