This is an automated email from the ASF dual-hosted git repository.

trohrmann pushed a commit to branch release-1.9
in repository https://gitbox.apache.org/repos/asf/flink.git


The following commit(s) were added to refs/heads/release-1.9 by this push:
     new f32ea2f  [FLINK-17643][tests] Fix LaunchCoordinatorTest instability by 
completing stubbing
f32ea2f is described below

commit f32ea2f1d078bd519687cdf766fb18f1d76d8f63
Author: Till Rohrmann <[email protected]>
AuthorDate: Wed May 13 10:40:10 2020 +0200

    [FLINK-17643][tests] Fix LaunchCoordinatorTest instability by completing 
stubbing
    
    The LaunchCoordinatorTest was susceptible to test failures because a test 
did not fully
    define a mock. The test scheduled a scheduled action which, if executed 
long enough, would
    be triggered and then call into an incomplete mock causing a NPE.
    
    This closes #12114.
---
 .../scala/org/apache/flink/mesos/scheduler/LaunchCoordinatorTest.scala | 3 +++
 1 file changed, 3 insertions(+)

diff --git 
a/flink-mesos/src/test/scala/org/apache/flink/mesos/scheduler/LaunchCoordinatorTest.scala
 
b/flink-mesos/src/test/scala/org/apache/flink/mesos/scheduler/LaunchCoordinatorTest.scala
index 3b175d3..2f7222d 100644
--- 
a/flink-mesos/src/test/scala/org/apache/flink/mesos/scheduler/LaunchCoordinatorTest.scala
+++ 
b/flink-mesos/src/test/scala/org/apache/flink/mesos/scheduler/LaunchCoordinatorTest.scala
@@ -379,6 +379,9 @@ class LaunchCoordinatorTest
       }
       "ResourceOffers" which {
         "stays in GatheringOffers with offer queue updated" in new Context {
+          private val result: SchedulingResult = schedulingResult(successes = 
Nil)
+          when(optimizer.scheduleOnce(MM.any(), MM.any())).thenReturn(result)
+
           fsm.setState(GatheringOffers,
             GatherData(tasks = Seq(task1._2), newLeases = 
Seq(lease(slave1._3))))
           fsm ! new ResourceOffers(Seq(slave1._4, slave2._3).asJava)

Reply via email to