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

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

                Author: ASF GitHub Bot
            Created on: 04/Nov/21 19:51
            Start Date: 04/Nov/21 19:51
    Worklog Time Spent: 10m 
      Work Description: arjun4084346 commented on a change in pull request 
#3403:
URL: https://github.com/apache/gobblin/pull/3403#discussion_r743155647



##########
File path: 
gobblin-service/src/test/java/org/apache/gobblin/service/monitoring/MysqlJobStatusRetrieverTestWithoutDagManager.java
##########
@@ -0,0 +1,173 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.gobblin.service.monitoring;
+
+import java.io.IOException;
+import java.util.Iterator;
+import java.util.Properties;
+
+import org.testng.Assert;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
+import com.google.common.base.Strings;
+
+import org.apache.gobblin.config.ConfigBuilder;
+import org.apache.gobblin.configuration.ConfigurationKeys;
+import org.apache.gobblin.configuration.State;
+import org.apache.gobblin.metastore.MysqlJobStatusStateStore;
+import org.apache.gobblin.metastore.testing.ITestMetastoreDatabase;
+import org.apache.gobblin.metastore.testing.TestMetastoreDatabaseFactory;
+import org.apache.gobblin.metrics.event.TimingEvent;
+import org.apache.gobblin.runtime.troubleshooter.MultiContextIssueRepository;
+import org.apache.gobblin.service.ExecutionStatus;
+import org.apache.gobblin.service.ServiceConfigKeys;
+
+import static org.mockito.Mockito.mock;
+
+
+public class MysqlJobStatusRetrieverTestWithoutDagManager extends 
JobStatusRetrieverTest {
+  private MysqlJobStatusStateStore<State> dbJobStateStore;
+  private static final String TEST_USER = "testUser";
+  private static final String TEST_PASSWORD = "testPassword";
+
+  @BeforeClass
+  @Override
+  public void setUp() throws Exception {
+    ITestMetastoreDatabase testMetastoreDatabase = 
TestMetastoreDatabaseFactory.get();
+    String jdbcUrl = testMetastoreDatabase.getJdbcUrl();
+
+    ConfigBuilder configBuilder = ConfigBuilder.create();
+    
configBuilder.addPrimitive(MysqlJobStatusRetriever.MYSQL_JOB_STATUS_RETRIEVER_PREFIX
 + "." + ConfigurationKeys.STATE_STORE_DB_URL_KEY, jdbcUrl);
+    
configBuilder.addPrimitive(MysqlJobStatusRetriever.MYSQL_JOB_STATUS_RETRIEVER_PREFIX
 + "." + ConfigurationKeys.STATE_STORE_DB_USER_KEY, TEST_USER);
+    
configBuilder.addPrimitive(MysqlJobStatusRetriever.MYSQL_JOB_STATUS_RETRIEVER_PREFIX
 + "." + ConfigurationKeys.STATE_STORE_DB_PASSWORD_KEY, TEST_PASSWORD);
+
+    this.jobStatusRetriever =
+        new MysqlJobStatusRetriever(configBuilder.build(), 
mock(MultiContextIssueRepository.class));
+    
configBuilder.addPrimitive(ServiceConfigKeys.GOBBLIN_SERVICE_DAG_MANAGER_ENABLED_KEY,
 "true");
+    this.dbJobStateStore = ((MysqlJobStatusRetriever) 
this.jobStatusRetriever).getStateStore();
+    cleanUpDir();
+  }
+
+  @Test
+  public void testGetJobStatusesForFlowExecution() throws IOException {
+    super.testGetJobStatusesForFlowExecution();
+  }
+
+  @Test (dependsOnMethods = "testGetJobStatusesForFlowExecution")
+  public void testJobTiming() throws Exception {
+    super.testJobTiming();
+  }
+
+  @Test (dependsOnMethods = "testJobTiming")
+  public void testOutOfOrderJobTimingEvents() throws IOException {
+    super.testOutOfOrderJobTimingEvents();
+  }
+
+  @Test (dependsOnMethods = "testJobTiming")
+  public void testGetJobStatusesForFlowExecution1() {
+    super.testGetJobStatusesForFlowExecution1();
+  }
+
+  @Test (dependsOnMethods = "testGetJobStatusesForFlowExecution1")
+  public void testGetLatestExecutionIdsForFlow() throws Exception {
+    super.testGetLatestExecutionIdsForFlow();
+  }
+
+  @Test (dependsOnMethods = "testGetLatestExecutionIdsForFlow")
+  public void testGetFlowStatusFromJobStatuses() throws Exception {
+    long flowExecutionId = 1237L;
+
+    addJobStatusToStateStore(flowExecutionId, JobStatusRetriever.NA_KEY, 
ExecutionStatus.COMPILED.name());
+    Assert.assertEquals(ExecutionStatus.$UNKNOWN,
+        
jobStatusRetriever.getFlowStatusFromJobStatuses(jobStatusRetriever.dagManagerEnabled,
 jobStatusRetriever.getJobStatusesForFlowExecution(FLOW_NAME, FLOW_GROUP, 
flowExecutionId)));

Review comment:
       maybe it was static in b/w changes. not now




-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

    Worklog Id:     (was: 676688)
    Time Spent: 2h 20m  (was: 2h 10m)

> fix flow status reporting when dag manager is not enabled
> ---------------------------------------------------------
>
>                 Key: GOBBLIN-1552
>                 URL: https://issues.apache.org/jira/browse/GOBBLIN-1552
>             Project: Apache Gobblin
>          Issue Type: Bug
>            Reporter: Arjun Singh Bora
>            Priority: Major
>          Time Spent: 2h 20m
>  Remaining Estimate: 0h
>
> flow status is determined by looking at the flow level events. but flow level 
> events are not emitted outside of dag manager. so currently flow status is 
> not being determined correctly when dag manager is disabled



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to