Skip to content
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

ssh/runcmd(): add if_stdout=False #36

Merged
merged 1 commit into from
Jan 22, 2024
Merged

Conversation

Junefen
Copy link
Member

@Junefen Junefen commented Jan 17, 2024

Description
When get the libvirt guest ip, sometime it fails with error RTTVAR has grown to over 2.3 seconds, decreasing to 2.0 due to the network delay. Now added a new param if_stdout=False to the runcmd() function, so we can directly get the stdout, which will be the correct ip address.

Test Result - PASS

% python3 -m pytest -v tests/others/test_hypervisors_state.py -k 'libvirt' 
========================================================= test session starts =========================================================
platform darwin -- Python 3.11.2, pytest-7.2.2, pluggy-1.0.0 -- /opt/homebrew/opt/[email protected]/bin/python3.11
cachedir: .pytest_cache
rootdir: /Users/yuefliu/workspace/virtwho-test, configfile: pytest.ini
collected 7 items / 6 deselected / 1 selected                                                                                         

tests/others/test_hypervisors_state.py::TestHypervisorsState::test_state_libvirt PASSED                                         [100%]

================================================== 1 passed, 6 deselected in 21.27s ===================================================

@Junefen Junefen requested a review from hkx303 January 17, 2024 08:15
@Junefen Junefen self-assigned this Jan 17, 2024
Copy link
Member

@hkx303 hkx303 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch

@hkx303 hkx303 merged commit 99ff27f into VirtwhoQE:master Jan 22, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants