This is an automated email from the ASF dual-hosted git repository.
hxb pushed a commit to branch release-1.18
in repository https://gitbox.apache.org/repos/asf/flink.git
The following commit(s) were added to refs/heads/release-1.18 by this push:
new 5c16321b806 [FLINK-34202][python] Optimize Python nightly CI time
(#24321)
5c16321b806 is described below
commit 5c16321b8064859d68004462410c8fcfd3ca0b2f
Author: HuangXingBo <[email protected]>
AuthorDate: Wed Feb 21 14:44:26 2024 +0800
[FLINK-34202][python] Optimize Python nightly CI time (#24321)
(cherry picked from commit 95163e89c84edbbad8477715739d3e5f2d80615e)
---
flink-python/dev/lint-python.sh | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/flink-python/dev/lint-python.sh b/flink-python/dev/lint-python.sh
index 1c0452b3cff..1a0235db491 100755
--- a/flink-python/dev/lint-python.sh
+++ b/flink-python/dev/lint-python.sh
@@ -596,7 +596,16 @@ function tox_check() {
# Only run test in latest python version triggered by a Git push
$TOX_PATH -vv -c $FLINK_PYTHON_DIR/tox.ini -e ${LATEST_PYTHON}
--recreate 2>&1 | tee -a $LOG_FILE
else
- $TOX_PATH -vv -c $FLINK_PYTHON_DIR/tox.ini --recreate 2>&1 | tee -a
$LOG_FILE
+ # Only run random selected python version in nightly CI.
+ ENV_LIST_STRING=`$TOX_PATH -l -c $FLINK_PYTHON_DIR/tox.ini`
+ _OLD_IFS=$IFS
+ IFS=$'\n'
+ ENV_LIST=(${ENV_LIST_STRING})
+ IFS=$_OLD_IFS
+
+ ENV_LIST_SIZE=${#ENV_LIST[@]}
+ index=$(($RANDOM % ENV_LIST_SIZE))
+ $TOX_PATH -vv -c $FLINK_PYTHON_DIR/tox.ini -e ${ENV_LIST[$index]}
--recreate 2>&1 | tee -a $LOG_FILE
fi
TOX_RESULT=$((grep -c "congratulations :)" "$LOG_FILE") 2>&1)