You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by tr...@apache.org on 2020/05/15 13:30:28 UTC

[flink] branch release-1.10 updated: [FLINK-17643][tests] Fix LaunchCoordinatorTest instability by completing stubbing

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

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


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

commit 9d149c6b055bf05cba291340ca7e6f58f087ad0a
Author: Till Rohrmann <tr...@apache.org>
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 00c23c6..c1f4c00 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
@@ -403,6 +403,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)