flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From StephanEwen <...@git.apache.org>
Subject [GitHub] flink pull request: implement a simple session management
Date Mon, 18 May 2015 14:06:05 GMT
Github user StephanEwen commented on a diff in the pull request:

    https://github.com/apache/flink/pull/681#discussion_r30509801
  
    --- 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 --
    
    This may be unstable on the CI infrastructure. A 1 second timeout and a 2 second check
may fail when the CI server is under load.
    
    In other tests, I simply loop and try multiple times up to a conservative value (such
as 15 seconds). That way the test succeeds fast under good conditions, but allows slack for
corner cases (loaded CI server, GC stall)


---
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