shirshanka commented on a change in pull request #2609: GOBBLIN-744: Support 
cancellation of a Helix workflow via a DELETE Spec.
URL: https://github.com/apache/incubator-gobblin/pull/2609#discussion_r277739662
 
 

 ##########
 File path: 
gobblin-cluster/src/test/java/org/apache/gobblin/cluster/ClusterIntegrationTest.java
 ##########
 @@ -51,28 +68,30 @@ public void testJobShouldComplete()
     runAndVerify();
   }
 
-  @Test void testJobShouldGetCancelled() throws Exception {
-    this.suite =new IntegrationJobCancelSuite();
+  private HelixManager getHelixManager() {
     Config helixConfig = this.suite.getManagerConfig();
     String clusterName = 
helixConfig.getString(GobblinClusterConfigurationKeys.HELIX_CLUSTER_NAME_KEY);
     String instanceName = ConfigUtils.getString(helixConfig, 
GobblinClusterConfigurationKeys.HELIX_INSTANCE_NAME_KEY,
         GobblinClusterManager.class.getSimpleName());
-    String zkConnectString = 
helixConfig.getString(GobblinClusterConfigurationKeys.ZK_CONNECTION_STRING_KEY);
+    this.zkConnectString = 
helixConfig.getString(GobblinClusterConfigurationKeys.ZK_CONNECTION_STRING_KEY);
     HelixManager helixManager = 
HelixManagerFactory.getZKHelixManager(clusterName, instanceName, 
InstanceType.CONTROLLER, zkConnectString);
+    return helixManager;
+  }
 
+  @Test void testJobShouldGetCancelled() throws Exception {
+    this.suite =new IntegrationJobCancelSuite();
+    HelixManager helixManager = getHelixManager();
     suite.startCluster();
-
     helixManager.connect();
 
     TaskDriver taskDriver = new TaskDriver(helixManager);
 
-    while (TaskDriver.getWorkflowContext(helixManager, 
IntegrationJobCancelSuite.JOB_ID) == null) {
-      log.warn("Waiting for the job to start...");
-      Thread.sleep(1000L);
-    }
+    AssertWithBackoff asserter1 = 
AssertWithBackoff.create().maxSleepMs(1000).backoffFactor(1);
+    asserter1.assertTrue(isTaskStarted(helixManager, 
IntegrationJobCancelSuite.JOB_ID),
 
 Review comment:
   you could chain the entire call without needing the local variable asserter1

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to