You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2022/11/08 12:42:03 UTC

[GitHub] [shardingsphere] sandynz commented on a diff in pull request #22013: Improve migration IT, use a separate key generate and add wait job prepare success check method

sandynz commented on code in PR #22013:
URL: https://github.com/apache/shardingsphere/pull/22013#discussion_r1016583271


##########
test/integration-test/scaling/src/test/java/org/apache/shardingsphere/integration/data/pipeline/cases/base/BaseITCase.java:
##########
@@ -224,6 +225,16 @@ protected void proxyExecuteWithLog(final String sql, final int sleepSeconds) thr
         ThreadUtil.sleep(Math.max(sleepSeconds, 0), TimeUnit.SECONDS);
     }
     
+    protected void waitJobPrepareSuccess(final String distSQL) {
+        for (int i = 0; i < 5; i++) {
+            List<Map<String, Object>> jobStatus = queryForListWithLog(distSQL);
+            Set<String> statusSet = jobStatus.stream().map(each -> String.valueOf(each.get("status"))).collect(Collectors.toSet());
+            if (statusSet.contains(JobStatus.PREPARING.name()) || statusSet.contains(JobStatus.RUNNING.name()) || statusSet.contains(JobStatus.PREPARE_SUCCESS.name())) {
+                ThreadUtil.sleep(2, TimeUnit.SECONDS);
+            }

Review Comment:
   Seems it does not need to sleep when job status is `PREPARE_SUCCESS`



-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org