flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mxm <...@git.apache.org>
Subject [GitHub] flink pull request: implement a simple session management
Date Wed, 20 May 2015 10:09:23 GMT
Github user mxm commented on a diff in the pull request:

    https://github.com/apache/flink/pull/681#discussion_r30686981
  
    --- Diff: flink-runtime/src/test/scala/org/apache/flink/runtime/jobmanager/JobManagerITCase.scala
---
    @@ -609,6 +612,98 @@ WordSpecLike with Matchers with BeforeAndAfterAll {
             cluster.stop()
           }
         }
    +
    +    "remove execution graphs when the client ends the session explicitly" in {
    +      val vertex = new AbstractJobVertex("Test Vertex")
    +      vertex.setInvokableClass(classOf[NoOpInvokable])
    +
    +      val slowVertex = new AbstractJobVertex("Slow Vertex")
    +      slowVertex.setInvokableClass(classOf[WaitingNoOpInvokable])
    +
    +      val sessionID = UUID.randomUUID()
    +
    +      val jobGraph1 = new JobGraph("Test Job", vertex)
    +      jobGraph1.setSessionID(sessionID)
    +      jobGraph1.setSessionTimeout(9 hours)
    +
    +      val jobGraph2 = new JobGraph("Slow Test Job", slowVertex)
    +      jobGraph2.setSessionID(sessionID)
    +      jobGraph2.setSessionTimeout(9 hours)
    +
    +      val cluster = TestingUtils.startTestingCluster(1)
    +      val jm = cluster.getJobManager
    +
    +      try {
    +        within(TestingUtils.TESTING_DURATION) {
    +          jm ! SubmitJob(jobGraph1, false)
    +          expectMsg(Success(jobGraph1.getJobID))
    +          expectMsgType[JobResultSuccess]
    +
    +          jm ! SubmitJob(jobGraph2, false)
    +
    +          // remove jobs while jobGraph2 is still running
    +          jm ! RemoveCachedJobs(sessionID)
    +
    +          expectMsg(Success(jobGraph2.getJobID))
    +          expectMsgType[JobResultSuccess]
    +
    +          jm ! RequestExecutionGraph(jobGraph1.getJobID)
    +          val graph1 = expectMsgType[ExecutionGraphFound].executionGraph
    +          assert(graph1.isArchived)
    +
    +          jm ! RequestExecutionGraph(jobGraph2.getJobID)
    +          val graph2 = expectMsgType[ExecutionGraphFound].executionGraph
    +          assert(graph2.isArchived)
    +        }
    +      } finally {
    +        cluster.stop()
    +      }
    +    }
    +
    +    "remove execution graphs when when the client's session times out" in {
    +      val vertex = new AbstractJobVertex("Test Vertex")
    +      vertex.setParallelism(1)
    +      vertex.setInvokableClass(classOf[NoOpInvokable])
    +
    +      val sessionID = UUID.randomUUID()
    +
    +      val jobGraph1 = new JobGraph("Test Job", vertex)
    +      jobGraph1.setSessionID(sessionID)
    +      jobGraph1.setSessionTimeout(1 second)
    +
    +      val jobGraph2 = new JobGraph("Test Job", vertex)
    +      jobGraph2.setSessionID(sessionID)
    +      jobGraph2.setSessionTimeout(1 second)
    +
    +      val cluster = TestingUtils.startTestingCluster(1)
    +      val jm = cluster.getJobManager
    +
    +      try {
    +        within(TestingUtils.TESTING_DURATION) {
    +          jm ! SubmitJob(jobGraph1, false)
    +          expectMsg(Success(jobGraph1.getJobID))
    +          expectMsgType[JobResultSuccess]
    +
    +          jm ! SubmitJob(jobGraph2, false)
    +          expectMsg(Success(jobGraph2.getJobID))
    +          expectMsgType[JobResultSuccess]
    +
    +          // wait until graph is archived
    +          Thread.sleep(2000)
    --- End diff --
    
    I see how this could potentially be a problem even with a second timeout. Will fix the
test with a loop like you suggested.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message