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

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

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


##########
gobblin-service/src/test/java/org/apache/gobblin/service/GobblinServiceManagerTest.java:
##########
@@ -403,34 +425,48 @@ public void testCreateAgain() throws Exception {
     Assert.assertEquals(exception.getStatus(), HttpStatus.CONFLICT_409);
   }
 
+  /*
+  This test adds a new flowConfig to the client checks the config retrieved 
using the getFlowConfig endpoint matches it
+   */
   @Test (dependsOnMethods = "testCreateAgain")
   public void testGet() throws Exception {
-    FlowConfig flowConfig = this.flowConfigClient.getFlowConfig(TEST_FLOW_ID);
+    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(flowConfig.getId().getFlowGroup(), TEST_GROUP_NAME);
-    Assert.assertEquals(flowConfig.getId().getFlowName(), TEST_FLOW_NAME);
-    Assert.assertEquals(flowConfig.getSchedule().getCronSchedule(), 
TEST_SCHEDULE);
-    Assert.assertEquals(flowConfig.getTemplateUris(), TEST_TEMPLATE_URI);
-    Assert.assertTrue(flowConfig.getSchedule().isRunImmediately());
+    FlowConfig getFlowConfig = this.flowConfigClient.getFlowConfig(flowId);
+    Assert.assertEquals(getFlowConfig.getId().getFlowGroup(), TEST_GROUP_NAME);
+    Assert.assertEquals(getFlowConfig.getId().getFlowName(), 
flowId.getFlowName());
+    Assert.assertEquals(getFlowConfig.getSchedule().getCronSchedule(), 
TEST_SCHEDULE);
+    Assert.assertEquals(getFlowConfig.getTemplateUris(), TEST_TEMPLATE_URI);
+    Assert.assertTrue(getFlowConfig.getSchedule().isRunImmediately());
     // Add this assert back when getFlowSpec() is changed to return the raw 
flow spec
-    //Assert.assertEquals(flowConfig.getProperties().size(), 1);
-    Assert.assertEquals(flowConfig.getProperties().get("param1"), "value1");
+    //Assert.assertEquals(getFlowConfig.getProperties().size(), 1);
+    Assert.assertEquals(getFlowConfig.getProperties().get("param1"), "value1");
   }
 
-  @Test (dependsOnMethods = "testCreateAgain")
+  /*
+    Adds one more flowConfig to the flowCatalog, checks that the size 
increased, and then deletes the one it just added
+   */
+  @Test (dependsOnMethods = "testGet")
   public void testGetAll() throws Exception {
-    FlowConfig flowConfig2 = new FlowConfig().setId(TEST_FLOW_ID2)
+    int sizeBefore = this.flowConfigClient.getAllFlowConfigs().size();
+    FlowId flowId = createFlowIdWithUniqueName(TEST_GROUP_NAME);
+    FlowConfig flowConfig = new FlowConfig().setId(flowId)
         .setTemplateUris(TEST_TEMPLATE_URI).setSchedule(new 
Schedule().setCronSchedule(TEST_SCHEDULE))
         .setProperties(new StringMap(flowProperties));
-    this.flowConfigClient.createFlowConfig(flowConfig2);
+    this.flowConfigClient.createFlowConfig(flowConfig);
     Collection<FlowConfig> flowConfigs = 
this.flowConfigClient.getAllFlowConfigs();
 
-    Assert.assertEquals(flowConfigs.size(), 2);
+    Assert.assertEquals(flowConfigs.size(), sizeBefore + 1);
 
-    this.flowConfigClient.deleteFlowConfig(TEST_FLOW_ID2);
+    this.flowConfigClient.deleteFlowConfig(flowId);
   }
 
-  @Test (dependsOnMethods = "testCreateAgain", enabled = false)
+  // TODO: re-enable after updating filters
+  @Test (dependsOnMethods = "testGetAll", enabled = false, groups = 
{"disabledOnCI"})

Review Comment:
   this does not work either?





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

    Worklog Id:     (was: 901072)
    Time Spent: 50m  (was: 40m)

> 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: 50m
>  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