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

Improvement to random port allocation for redis testing #591

Merged
merged 3 commits into from
May 18, 2021

Conversation

sameh-farouk
Copy link
Member

@sameh-farouk sameh-farouk commented May 12, 2021

Description

While running the Redis test suite it tries to find a random port for redis-server using the python random module. using this method it is possible to get an already used port and the test will then fail.

to get a free port properly we should bind to port 0 to make the OS pick a random available port from 1024 to 65535.

Changes

  • switch to use the nettools's get_free_port function.

Checklist

  • Pre-commit hook is installed to do formatting checks before committing code...etc
  • Tests included
  • Build pass
  • Documentation
  • Code format and docstrings

…hen runs the Redis tests

- using nettools sal instaed of the python `random` module
@codecov-commenter
Copy link

Codecov Report

Merging #591 (2fa81dc) into development (2eec7af) will increase coverage by 0.14%.
The diff coverage is n/a.

Impacted file tree graph

@@               Coverage Diff               @@
##           development     #591      +/-   ##
===============================================
+ Coverage        69.67%   69.81%   +0.14%     
===============================================
  Files               84       84              
  Lines             4283     4283              
===============================================
+ Hits              2984     2990       +6     
+ Misses            1299     1293       -6     
Impacted Files Coverage Δ
jumpscale/sals/process/__init__.py 65.28% <0.00%> (+1.10%) ⬆️
jumpscale/tools/startupcmd/startupcmd.py 86.79% <0.00%> (+1.25%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2eec7af...2fa81dc. Read the comment docs.

@abom
Copy link
Contributor

abom commented May 17, 2021

@sameh-farouk I think this need to be used elsewhere too in tests, can we check other tests?

@sameh-farouk
Copy link
Member Author

@abom updated to include those tests from process sal

@abom abom merged commit b4d9dd6 into development May 18, 2021
@abom abom deleted the development_tests_clients_redis_fix branch May 18, 2021 09:27
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.

4 participants