[
https://issues.apache.org/jira/browse/GOBBLIN-1990?focusedWorklogId=901081&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-901081
]
ASF GitHub Bot logged work on GOBBLIN-1990:
-------------------------------------------
Author: ASF GitHub Bot
Created on: 23/Jan/24 00:47
Start Date: 23/Jan/24 00:47
Worklog Time Spent: 10m
Work Description: umustafi commented on code in PR #3864:
URL: https://github.com/apache/gobblin/pull/3864#discussion_r1462600348
##########
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:
need to update the tests to check for flow execution ids that were just
added. Again want to time box these fixes. I can do if seems useful but this is
also tested down below in some other tests.
Issue Time Tracking
-------------------
Worklog Id: (was: 901081)
Time Spent: 1h 40m (was: 1.5h)
> 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: 1h 40m
> 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)