@Test public void testSparkProgramStatusSchedule() throws Exception { ApplicationManager appManager = deploy(TestSparkApp.class); ScheduleId scheduleId = new ScheduleId(NamespaceId.DEFAULT.getNamespace(), TestSparkApp.class.getSimpleName(), "schedule"); appManager.enableSchedule(scheduleId); WorkflowManager workflowManager = appManager.getWorkflowManager(TestSparkApp.TriggeredWorkflow.class.getSimpleName()); int numRuns = workflowManager.getHistory(ProgramRunStatus.COMPLETED).size(); // Start the upstream program SparkManager sparkManager = appManager.getSparkManager(TestSparkApp.ScalaClassicSpark.class.getSimpleName()); sparkManager.start(); // Wait for the downstream to complete workflowManager.waitForRun(ProgramRunStatus.COMPLETED, 5, TimeUnit.MINUTES); // Run again with the kryo serializer sparkManager.start(Collections.singletonMap("spark.serializer", "org.apache.spark.serializer.KryoSerializer")); // Wait for the downstream to complete again workflowManager.waitForRuns(ProgramRunStatus.COMPLETED, numRuns + 2, 5, TimeUnit.MINUTES); }