Skip to content

Commit

Permalink
Create fake TaskInfo using dummy fields instead of Mockito.
Browse files Browse the repository at this point in the history
This fixes some spurious exceptions in JobProgressListener that cluttered
up the DAGSchedulerSuite unit tests log.
  • Loading branch information
JoshRosen committed Feb 3, 2015
1 parent 997b41b commit a7c0e29
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import scala.collection.mutable.{ArrayBuffer, HashSet, HashMap, Map}
import scala.language.reflectiveCalls
import scala.util.control.NonFatal

import org.mockito.Mockito.mock
import org.scalatest.{BeforeAndAfter, FunSuiteLike}
import org.scalatest.concurrent.Timeouts
import org.scalatest.time.SpanSugar._
Expand Down Expand Up @@ -770,7 +769,11 @@ class DAGSchedulerSuite extends FunSuiteLike with BeforeAndAfter with LocalSpar

// Nothing in this test should break if the task info's fields are null, but
// OutputCommitCoordinator requires the task info itself to not be null.
private def createFakeTaskInfo(): TaskInfo = mock(classOf[TaskInfo])
private def createFakeTaskInfo(): TaskInfo = {
val info = new TaskInfo(0, 0, 0, 0L, "", "", TaskLocality.ANY, false)
info.finishTime = 1 // to prevent spurious errors in JobProgressListener
info
}

}

0 comments on commit a7c0e29

Please sign in to comment.