twalthr commented on a change in pull request #7265: [FLINK-10964] SQL-client 
throws exception when paging through finished batch query
URL: https://github.com/apache/flink/pull/7265#discussion_r245621309
 
 

 ##########
 File path: 
flink-libraries/flink-sql-client/src/test/java/org/apache/flink/table/client/gateway/local/LocalExecutorITCase.java
 ##########
 @@ -503,4 +596,70 @@ private void verifySinkResult(String path) throws 
IOException {
                }
                return actualResults;
        }
+
+       private List<String> retrieveChangelogResultAfterJobFinished(
+               Executor executor,
+               SessionContext session,
+               String resultID,
+               ResultDescriptor descriptor) throws InterruptedException {
+
+               final List<String> actualResults = new ArrayList<>();
+               while (true) {
+                       Thread.sleep(50); // slow the processing down
+                       final TypedResult<List<Tuple2<Boolean, Row>>> result =
+                               executor.retrieveResultChanges(session, 
resultID);
+                       if (result.getType() == TypedResult.ResultType.PAYLOAD) 
{
+                               for (Tuple2<Boolean, Row> change : 
result.getPayload()) {
+                                       actualResults.add(change.toString());
+                               }
+                       } else if (result.getType() == 
TypedResult.ResultType.EOS) {
+                               Thread cliChangelogResultViewRunner = null;
+                               try {
+                                       cliChangelogResultViewRunner = new 
Thread(new TestingCliResultView(executor, session, descriptor, false));
+                                       cliChangelogResultViewRunner.start();
+
+                                       //wait enough time to trigger 
CliTableResultView#refresh call stopRetrieval method
+                                       Thread.sleep(5000);
 
 Review comment:
   Remove all hard sleeps because they make our tests slow. 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to