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 committed Feb 10, 2023
1 parent ae89c99 commit 6948b09
Showing 1 changed file with 9 additions and 4 deletions.
Expand Up @@ -290,10 +290,15 @@ 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
taskManager.copyFileFromContainer(resultFilePath, tempOutputFilepath);
numberOfResultRecords = UpsertTestFileUtil.getNumberOfRecords(tempOutputFile);
if (numberOfResultRecords == expectedNumberOfRecords) {
break;
}
}
assertThat(numberOfResultRecords).isEqualTo(expectedNumberOfRecords);
}

Expand Down

0 comments on commit 6948b09

Please sign in to comment.