[ 
https://issues.apache.org/jira/browse/GOBBLIN-1990?focusedWorklogId=901305&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-901305
 ]

ASF GitHub Bot logged work on GOBBLIN-1990:
-------------------------------------------

                Author: ASF GitHub Bot
            Created on: 24/Jan/24 02:12
            Start Date: 24/Jan/24 02:12
    Worklog Time Spent: 10m 
      Work Description: arjun4084346 commented on code in PR #3864:
URL: https://github.com/apache/gobblin/pull/3864#discussion_r1464214122


##########
gobblin-service/src/test/java/org/apache/gobblin/service/GobblinServiceManagerTest.java:
##########
@@ -359,40 +364,57 @@ public void testRunQuotaExceeds() throws Exception {
     try {
       this.flowConfigClient.createFlowConfig(flowConfig2);
     } catch (RestLiResponseException e) {
+      /* Note: this exception may NOT occur if the first job above is 
processed immediately so TEST_FLOW_ID2 will remain
+      in the FlowCatalog
+       */
       Assert.assertEquals(e.getStatus(), HttpStatus.SERVICE_UNAVAILABLE_503);
     }
   }
 
-  @Test (dependsOnMethods = "testRunQuotaExceeds")
+  @Test (dependsOnMethods = "testUncompilableJob")
   public void testExplainJob() throws Exception {
     int sizeBeforeTest = 
this.gobblinServiceManager.getFlowCatalog().getSpecs().size();
-    FlowConfig flowConfig = new FlowConfig().setId(new 
FlowId().setFlowGroup(TEST_GROUP_NAME).setFlowName(TEST_FLOW_NAME))
+    FlowId flowId = createFlowIdWithUniqueName(TEST_GROUP_NAME);
+    FlowConfig flowConfig = new FlowConfig().setId(flowId)
         .setTemplateUris(TEST_TEMPLATE_URI).setProperties(new 
StringMap(flowProperties)).setExplain(true);
 
     this.flowConfigClient.createFlowConfig(flowConfig);
 
     // explain job should not be persisted
     
Assert.assertEquals(this.gobblinServiceManager.getFlowCatalog().getSpecs().size(),
 sizeBeforeTest);
-    
Assert.assertFalse(this.gobblinServiceManager.getScheduler().getScheduledFlowSpecs().containsKey(TEST_URI.toString()));
+    
Assert.assertFalse(this.gobblinServiceManager.getScheduler().getScheduledFlowSpecs().containsKey(flowId.toString()));
   }
 
+  /*
+  Tests createFlowConfig method by adding a new flow.
+   */
   @Test (dependsOnMethods = "testExplainJob")
   public void testCreate() throws Exception {
-    FlowConfig flowConfig = new FlowConfig().setId(TEST_FLOW_ID)
+    int sizeBeforeTest = 
this.gobblinServiceManager.getFlowCatalog().getSpecs().size();
+    FlowId flowId = createFlowIdWithUniqueName(TEST_GROUP_NAME);
+    FlowConfig flowConfig = new FlowConfig().setId(flowId)
         .setTemplateUris(TEST_TEMPLATE_URI).setSchedule(new 
Schedule().setCronSchedule(TEST_SCHEDULE).setRunImmediately(true))
         .setProperties(new StringMap(flowProperties));
 
     this.flowConfigClient.createFlowConfig(flowConfig);
-    
Assert.assertEquals(this.gobblinServiceManager.getFlowCatalog().getSpecs().size(),
 1);
-    
Assert.assertTrue(this.gobblinServiceManager.getScheduler().getScheduledFlowSpecs().containsKey(TEST_URI.toString()));
+    
Assert.assertEquals(this.gobblinServiceManager.getFlowCatalog().getSpecs().size(),
 sizeBeforeTest + 1);
+    // TODO: remove scheduler related assertions until they are debugged
+    // 
Assert.assertTrue(this.gobblinServiceManager.getScheduler().getScheduledFlowSpecs().containsKey(flowId.toString()));

Review Comment:
   I think these tests are even more important now when we are adding so much 
code related to scheduling.
   Let's debug them together.
   Why cannot we make (or wait till) scheduler become active?





Issue Time Tracking
-------------------

    Worklog Id:     (was: 901305)
    Time Spent: 3h  (was: 2h 50m)

> Update GobblinServiceManagerTest to reduce flakiness
> ----------------------------------------------------
>
>                 Key: GOBBLIN-1990
>                 URL: https://issues.apache.org/jira/browse/GOBBLIN-1990
>             Project: Apache Gobblin
>          Issue Type: Bug
>          Components: gobblin-service
>            Reporter: Urmi Mustafi
>            Assignee: Abhishek Tiwari
>            Priority: Major
>          Time Spent: 3h
>  Remaining Estimate: 0h
>
> {{GobblinServiceManager}} tests are timing dependent and depend on state from 
> other unit tests. They frequently fail, showing different results on IDE 
> versus run in terminal with Gradle. We don't want to disable too many of them 
> since they are useful. However, we want to remove timing dependent tests and 
> decouple the tests so they do not depend on state from another test.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to