Skip to content

Commit

Permalink
[FLINK-30257] fix SqlClientITCase#testMatchRecognize
Browse files Browse the repository at this point in the history
  • Loading branch information
WencongLiu authored and dmvk committed May 25, 2023
1 parent 23030f6 commit 853976e
Showing 1 changed file with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -290,10 +290,18 @@ private void verifyNumberOfResultRecords(String resultFilePath, int expectedNumb
File tempOutputFile = new File(tempDir, "records.out");
String tempOutputFilepath = tempOutputFile.toString();
GenericContainer<?> taskManager = flink.getTaskManagers().get(0);
Thread.sleep(5000); // prevent NotFoundException: Status 404
taskManager.copyFileFromContainer(resultFilePath, tempOutputFilepath);

int numberOfResultRecords = UpsertTestFileUtil.getNumberOfRecords(tempOutputFile);
int numberOfResultRecords;
while (true) {
Thread.sleep(50); // prevent NotFoundException: Status 404
try {
taskManager.copyFileFromContainer(resultFilePath, tempOutputFilepath);
numberOfResultRecords = UpsertTestFileUtil.getNumberOfRecords(tempOutputFile);
if (numberOfResultRecords == expectedNumberOfRecords) {
break;
}
} catch (Exception ignored) {
}
}
assertThat(numberOfResultRecords).isEqualTo(expectedNumberOfRecords);
}

Expand Down

0 comments on commit 853976e

Please sign in to comment.