Skip to content
Snippets Groups Projects
Commit d9e724e7 authored by Reynold Xin's avatar Reynold Xin
Browse files

Fixed the broken local scheduler test.

parent 37397b73
No related branches found
No related tags found
No related merge requests found
...@@ -39,6 +39,7 @@ class JobCancellationSuite extends FunSuite with ShouldMatchers with BeforeAndAf ...@@ -39,6 +39,7 @@ class JobCancellationSuite extends FunSuite with ShouldMatchers with BeforeAndAf
with LocalSparkContext { with LocalSparkContext {
override def afterEach() { override def afterEach() {
super.afterEach()
System.clearProperty("spark.scheduler.mode") System.clearProperty("spark.scheduler.mode")
} }
......
...@@ -64,6 +64,7 @@ object TaskThreadInfo { ...@@ -64,6 +64,7 @@ object TaskThreadInfo {
class LocalSchedulerSuite extends FunSuite with LocalSparkContext with BeforeAndAfterEach { class LocalSchedulerSuite extends FunSuite with LocalSparkContext with BeforeAndAfterEach {
override def afterEach() { override def afterEach() {
super.afterEach()
System.clearProperty("spark.scheduler.mode") System.clearProperty("spark.scheduler.mode")
} }
...@@ -150,12 +151,13 @@ class LocalSchedulerSuite extends FunSuite with LocalSparkContext with BeforeAnd ...@@ -150,12 +151,13 @@ class LocalSchedulerSuite extends FunSuite with LocalSparkContext with BeforeAnd
} }
test("Local fair scheduler end-to-end test") { test("Local fair scheduler end-to-end test") {
sc = new SparkContext("local[8]", "LocalSchedulerSuite")
val sem = new Semaphore(0)
System.setProperty("spark.scheduler.mode", "FAIR") System.setProperty("spark.scheduler.mode", "FAIR")
val xmlPath = getClass.getClassLoader.getResource("fairscheduler.xml").getFile() val xmlPath = getClass.getClassLoader.getResource("fairscheduler.xml").getFile()
System.setProperty("spark.scheduler.allocation.file", xmlPath) System.setProperty("spark.scheduler.allocation.file", xmlPath)
sc = new SparkContext("local[8]", "LocalSchedulerSuite")
val sem = new Semaphore(0)
createThread(10,"1",sc,sem) createThread(10,"1",sc,sem)
TaskThreadInfo.threadToStarted(10).await() TaskThreadInfo.threadToStarted(10).await()
createThread(20,"2",sc,sem) createThread(20,"2",sc,sem)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment