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

FastHttpLocust + SNI #1369

Closed
ecc256 opened this issue May 12, 2020 · 6 comments
Closed

FastHttpLocust + SNI #1369

ecc256 opened this issue May 12, 2020 · 6 comments
Labels

Comments

@ecc256
Copy link

ecc256 commented May 12, 2020

Getting weird issue with FastHttpLocust again.
It works fine from client.
But server (OpenResty) has SNI based bindings and show tons of errors like
... failed to get SNI ...
and falls back to default certificate. :(

Same exact code works fine with HttpLocust.
Don’t know how to help somebody to reproduce…

Am I missing something (simple?) with FastHttpLocust?
AFAIR, it’s up to the https client to send SNI or not, right?

url = f'{https}://{host}{url}'
headers = {
	'Host': host,
}
self.client.get(url, name=url, headers=headers)
(locust382) ubuntu@...:~$ conda list
# packages in environment at /home/ubuntu/anaconda3/envs/locust382:
#
# Name                    Version                   Build  Channel
_libgcc_mutex             0.1                        main  
ca-certificates           2020.1.1                      0  
certifi                   2020.4.5.1               py38_0  
chardet                   3.0.4                    pypi_0    pypi
click                     7.1.1                    pypi_0    pypi
configargparse            1.2.1                    pypi_0    pypi
flask                     1.1.2                    pypi_0    pypi
flask-basicauth           0.2.0                    pypi_0    pypi
gevent                    1.5.0                    pypi_0    pypi
geventhttpclient-wheels   1.3.1.dev3               pypi_0    pypi
greenlet                  0.4.15                   pypi_0    pypi
idna                      2.9                      pypi_0    pypi
itsdangerous              1.1.0                    pypi_0    pypi
jinja2                    2.11.2                   pypi_0    pypi
ld_impl_linux-64          2.33.1               h53a641e_7  
libedit                   3.1.20181209         hc058e9b_0  
libffi                    3.2.1                hd88cf55_4  
libgcc-ng                 9.1.0                hdf63c60_0  
libstdcxx-ng              9.1.0                hdf63c60_0  
locustio                  1.0.0                     dev_0    <develop>
markupsafe                1.1.1                    pypi_0    pypi
msgpack                   1.0.0                    pypi_0    pypi
ncurses                   6.2                  he6710b0_0  
openssl                   1.1.1g               h7b6447c_0  
pip                       20.0.2                   py38_1  
psutil                    5.7.0                    pypi_0    pypi
python                    3.8.2                hcf32534_0  
pyzmq                     19.0.0                   pypi_0    pypi
readline                  8.0                  h7b6447c_0  
requests                  2.23.0                   pypi_0    pypi
setuptools                46.1.3                   py38_0  
six                       1.14.0                   pypi_0    pypi
sqlite                    3.31.1               h62c20be_1  
tk                        8.6.8                hbc83047_0  
urllib3                   1.25.9                   pypi_0    pypi
werkzeug                  1.0.1                    pypi_0    pypi
wheel                     0.34.2                   py38_0  
xz                        5.2.5                h7b6447c_0  
zlib                      1.2.11               h7b6447c_3  
@ecc256 ecc256 added the bug label May 12, 2020
@heyman
Copy link
Member

heyman commented May 12, 2020

What version of Locust are you using? Have you tried with master? I did a fix for #1360 a week ago, but it hasn't gone out in any release yet.

@ecc256
Copy link
Author

ecc256 commented May 13, 2020

I was on
locustio 1.0.0 dev_0 <develop>
installed 4/22/2020
conda list is in my prev. message…

I’ve updated to
locustio 1.0b2 dev_0 <develop>
And I cannot even start locust now…
I’ve wiped and reinstalled conda env – it made no difference…
I did install with
pip install -e git://github.com/locustio/locust.git@master#egg=locustio
in both cases.
Logs are below:

Traceback (most recent call last):
  File "/home/ubuntu/anaconda3/envs/locust382/bin/locust", line 11, in <module>
    load_entry_point('locustio', 'console_scripts', 'locust')()
  File "/home/ubuntu/locust/src/locustio/locust/main.py", line 113, in main
    docstring, user_classes = load_locustfile(locustfile)
  File "/home/ubuntu/locust/src/locustio/locust/main.py", line 77, in load_locustfile
    imported = __import_locustfile__(locustfile, path)
  File "/home/ubuntu/locust/src/locustio/locust/main.py", line 53, in __import_locustfile__
    return  source.load_module()
  File "<frozen importlib._bootstrap_external>", line 462, in _check_name_wrapper
  File "<frozen importlib._bootstrap_external>", line 962, in load_module
  File "<frozen importlib._bootstrap_external>", line 787, in load_module
  File "<frozen importlib._bootstrap>", line 265, in _load_module_shim
  File "<frozen importlib._bootstrap>", line 702, in _load
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 783, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/home/ubuntu/locust/case2.py", line 1, in <module>
    from locust import HttpLocust, TaskSet, task, between
ImportError: cannot import name 'HttpLocust' from 'locust' (/home/ubuntu/locust/src/locustio/locust/__init__.py)

# packages in environment at /home/ubuntu/anaconda3/envs/locust382:
#
# Name                    Version                   Build  Channel
_libgcc_mutex             0.1                        main  
ca-certificates           2020.1.1                      0  
certifi                   2020.4.5.1               py38_0  
chardet                   3.0.4                    pypi_0    pypi
click                     7.1.2                    pypi_0    pypi
configargparse            1.2.3                    pypi_0    pypi
flask                     1.1.2                    pypi_0    pypi
flask-basicauth           0.2.0                    pypi_0    pypi
gevent                    20.5.0                   pypi_0    pypi
geventhttpclient-wheels   1.3.1.dev3               pypi_0    pypi
greenlet                  0.4.15                   pypi_0    pypi
idna                      2.9                      pypi_0    pypi
itsdangerous              1.1.0                    pypi_0    pypi
jinja2                    2.11.2                   pypi_0    pypi
ld_impl_linux-64          2.33.1               h53a641e_7  
libedit                   3.1.20181209         hc058e9b_0  
libffi                    3.3                  he6710b0_1  
libgcc-ng                 9.1.0                hdf63c60_0  
libstdcxx-ng              9.1.0                hdf63c60_0  
locustio                  1.0b2                     dev_0    <develop>
markupsafe                1.1.1                    pypi_0    pypi
msgpack                   1.0.0                    pypi_0    pypi
ncurses                   6.2                  he6710b0_1  
openssl                   1.1.1g               h7b6447c_0  
pip                       20.0.2                   py38_3  
psutil                    5.7.0                    pypi_0    pypi
python                    3.8.2               hcff3b4d_14  
pyzmq                     19.0.1                   pypi_0    pypi
readline                  8.0                  h7b6447c_0  
requests                  2.23.0                   pypi_0    pypi
setuptools                46.2.0                   py38_0  
six                       1.14.0                   pypi_0    pypi
sqlite                    3.31.1               h62c20be_1  
tk                        8.6.8                hbc83047_0  
urllib3                   1.25.9                   pypi_0    pypi
werkzeug                  1.0.1                    pypi_0    pypi
wheel                     0.34.2                   py38_0  
xz                        5.2.5                h7b6447c_0  
zlib                      1.2.11               h7b6447c_3  

@ecc256
Copy link
Author

ecc256 commented May 13, 2020

I've switched to introduce-type-hints for now.
At least I can keep running my tests...
Let me know if you want to me clarify or test something on master, please.

@heyman
Copy link
Member

heyman commented May 13, 2020

HttpLocust has been renamed to HttpUser (and the Locust class has been renamed to User) in 1.0.

For all backwards incompatible changes see: https://docs.locust.io/en/latest/changelog.html

I'm fairly hopeful that your SNI problem should go away if you switch to 1.0.

@ecc256
Copy link
Author

ecc256 commented May 14, 2020

Will try and let you know,
Thanks!

@ecc256
Copy link
Author

ecc256 commented May 18, 2020

Tested Locust 1.0.1
No more SNI with FastHttpUser!
Thanks a lot!

@ecc256 ecc256 closed this as completed May 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants