bmarcott commented on a change in pull request #27207: [SPARK-18886][CORE] Make 
Locality wait time measure resource under utilization due to delay scheduling.
URL: https://github.com/apache/spark/pull/27207#discussion_r400606676
 
 

 ##########
 File path: 
core/src/test/scala/org/apache/spark/scheduler/TaskSchedulerImplSuite.scala
 ##########
 @@ -901,18 +1136,17 @@ class TaskSchedulerImplSuite extends SparkFunSuite with 
LocalSparkContext with B
     }
 
     // Here is the main check of this test -- we have the same offers again, 
and we schedule it
-    // successfully.  Because the scheduler first tries to schedule with 
locality in mind, at first
-    // it won't schedule anything on executor1.  But despite that, we don't 
abort the job.  Then the
-    // scheduler tries for ANY locality, and successfully schedules tasks on 
executor1.
+    // successfully.  Because the scheduler tries to schedule with locality in 
mind, at first
+    // it won't schedule anything on executor1.  But despite that, we don't 
abort the job.
     val secondTaskAttempts = taskScheduler.resourceOffers(offers).flatten
-    assert(secondTaskAttempts.size == 2)
-    secondTaskAttempts.foreach { taskAttempt => assert("executor1" === 
taskAttempt.executorId) }
+    assert(secondTaskAttempts.isEmpty)
     assert(!failedTaskSet)
   }
 
   test("SPARK-16106 locality levels updated if executor added to existing 
host") {
     val taskScheduler = setupScheduler()
 
+    taskScheduler.resourceOffers(IndexedSeq(new WorkerOffer("executor0", 
"host0", 1)))
 
 Review comment:
   we don't need it, just otherwise the test behaves differently because the 
resources aren't scheduled the same (more resources are accepted up front with 
new code)
   I can also make the test pass by setting the legacy flag, or changing more 
logic in the test
   
   Previously the locality level would be reset on every task launch, now it is 
once per resourceOffers call.
   Workloads that relied on the old behavior would possibly regress.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to