public void checkResultWithTimeout(
            List<String> expectedResult, String table, int fieldsLen, long timeout)
            throws Exception {
        long endTimeout = System.currentTimeMillis() + timeout;
        boolean result = false;
        while (System.currentTimeMillis() < endTimeout) {
            try {
                checkResult(expectedResult, table, fieldsLen);
                result = true;
                break;
            } catch (AssertionError | SQLException throwable) {
                Thread.sleep(1000L);
            }
        }
        if (!result) {
            checkResult(expectedResult, table, fieldsLen);
        }
    }
Compare db select result and expected result in one time.
@param expectedResult
@param table
@param fieldsLen
@throws SQLException
@throws ClassNotFoundException
inlong-sort/sort-end-to-end-tests/sort-end-to-end-tests-v1.15/src/test/java/org/apache/inlong/sort/tests/utils/JdbcProxy.java