-
Notifications
You must be signed in to change notification settings - Fork 5k
fix: enhance SSH command handling for local hosts in clean_tmp and run_thread functions #31448
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…n_thread functions
|
遇到报错如下,这种一般就是run_container.sh 的参数中有空格之类的,导致识别参数识别错误。这次就是-c 后面跟的是python 的命令行,使用 eval $cmd 这种执行模式就能避免这类问题。如果是加上了远程执行,还是只能使用 $cmd |
… run_thread functions
…tion in clean_tmp and run_thread functions
… expected row counts in test cases
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request improves the handling of local and remote hosts in the test scripts by introducing a new helper function (is_local_host) and updating the command execution logic for consistency. Key changes include:
- Adding the is_local_host() helper to distinguish between local and remote hosts.
- Refactoring clean_tmp() and run_thread() functions to use bash -c for command execution and properly construct SSH/scp commands.
- Adjusting test cases and CI scripts to match updated expectations and improve environmental setup.
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/parallel_test/run.sh | Introduces is_local_host() and updates SSH command handling in clean_tmp() and run_thread(). |
| test/ci/run.sh | Adjusts the redo condition for thread runs with a configurable retry limit. |
| test/ci/cases.task | Updates test flags and rerun indicators for various test cases. |
| test/cases/50-Others/01-Valgrind/test_valgrind_checkerror1.py | Updates expected row count in valgrind check. |
| test/cases/22-Show/test_show_basic.py | Updates expected row count in show test cases. |
| packaging/tools/install_spec.sh | Modifies environment variable setup to remove early returns and ensure both PATH and LD_LIBRARY_PATH are updated. |
Comments suppressed due to low confidence (1)
packaging/tools/install_spec.sh:1033
- With the removal of the early return statements, verify that appending both PATH and LD_LIBRARY_PATH entries does not lead to duplicate entries in ~/.bashrc on subsequent runs.
if grep -q "export PATH=$bin_link_dir:\$PATH" ~/.bashrc; then
This pull request improves the handling of local and remote hosts in the
tests/parallel_test/run.shscript, ensuring commands are executed appropriately based on the host type. It introduces a new helper function,is_local_host(), to determine if a host is local, and updates several functions to use this logic for cleaner and more reliable execution.jira:https://jira.taosdata.com:18080/browse/TD-35700
Enhancements for handling local vs. remote hosts:
is_local_host()helper function: This function checks if a given host is local by comparing it against common local host identifiers (127.0.0.1,localhost, hostname, etc.).clean_tmp()function: Incorporatedis_local_host()to determine whether to execute commands directly or via SSH, ensuring proper handling of local hosts.run_thread()function:bash -cfor consistency and better handling of complex commands. [1] [2] [3]