Hisoka-X commented on code in PR #4996:
URL: https://github.com/apache/seatunnel/pull/4996#discussion_r1262023517


##########
seatunnel-e2e/seatunnel-engine-e2e/connector-seatunnel-e2e-base/src/test/java/org/apache/seatunnel/engine/e2e/LocalIT.java:
##########
@@ -0,0 +1,159 @@
+/*
+ * 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.seatunnel.engine.e2e;
+
+import org.apache.seatunnel.common.config.Common;
+import org.apache.seatunnel.common.config.DeployMode;
+import org.apache.seatunnel.engine.client.SeaTunnelClient;
+import org.apache.seatunnel.engine.client.job.ClientJobProxy;
+import org.apache.seatunnel.engine.client.job.JobExecutionEnvironment;
+import org.apache.seatunnel.engine.common.config.ConfigProvider;
+import org.apache.seatunnel.engine.common.config.JobConfig;
+import org.apache.seatunnel.engine.common.config.SeaTunnelConfig;
+import org.apache.seatunnel.engine.core.job.JobStatus;
+import org.apache.seatunnel.engine.server.SeaTunnelNodeContext;
+
+import org.awaitility.Awaitility;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+import 
org.testcontainers.shaded.org.apache.commons.lang3.tuple.ImmutableTriple;
+
+import com.google.common.collect.Lists;
+import com.hazelcast.client.config.ClientConfig;
+import com.hazelcast.cluster.Address;
+import com.hazelcast.cluster.Member;
+import com.hazelcast.core.HazelcastInstance;
+import com.hazelcast.instance.impl.HazelcastInstanceFactory;
+import lombok.extern.slf4j.Slf4j;
+
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.TimeUnit;
+
+@Slf4j
+public class LocalIT {
+
+    public static final String TEST_TEMPLATE_FILE_NAME = 
"stream_fakesource_to_console.conf";
+
+    @Test
+    public void testSubmitIndependentJobByLocalSever()
+            throws ExecutionException, InterruptedException {
+        ImmutableTriple<HazelcastInstance, SeaTunnelClient, ClientJobProxy> 
jobResult =
+                submitJobByLocalSever();
+        try {
+            Awaitility.await()
+                    .atMost(6, TimeUnit.MINUTES)
+                    .untilAsserted(
+                            () -> {
+                                Thread.sleep(2000);
+                                Assertions.assertTrue(
+                                        JobStatus.RUNNING.equals(
+                                                
jobResult.getRight().getJobStatus()));
+                            });
+        } finally {
+            close(jobResult);
+        }
+    }
+
+    @Test
+    public void testSubmitTwoIndependentJobByLocalSever()

Review Comment:
   Please use docker to create test case just like e2e in 
https://github.com/apache/seatunnel/tree/dev/seatunnel-e2e. You create two job 
in same instance, I think it can't prove the local tasks can run more than one 
job in the same time.
   
   Only create two JVM instance to run two job can make sure the feature are 
right.



##########
seatunnel-core/seatunnel-starter/src/main/java/org/apache/seatunnel/core/starter/seatunnel/command/ClientExecuteCommand.java:
##########
@@ -93,6 +97,13 @@ public void execute() throws CommandExecuteException {
             if (StringUtils.isNotEmpty(clusterName)) {
                 clientConfig.setClusterName(clusterName);
             }
+            if (null != instance) {
+                Address serverAddress = ((Member) 
instance.getLocalEndpoint()).getAddress();
+                String connectAddress = serverAddress.getHost() + ":" + 
serverAddress.getPort();
+
+                ClientNetworkConfig networkConfig = 
clientConfig.getNetworkConfig();
+                networkConfig.setAddresses(Lists.newArrayList(connectAddress));

Review Comment:
   This way only work on two job running on same JVM, is my thinking correct?



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

Reply via email to