yandex / yandex-tank

Load and performance benchmark tool
Other
2.46k stars 278 forks source link

Overload plugin don't use https proxy #307

Open c13 opened 7 years ago

c13 commented 7 years ago

Overload plugin don't use https proxy via "export https_proxy=ip" load.ini

[tank]
plugin_overload=yandextank.plugins.Overload

[overload]
# to obtain a token login to https://overload.yandex.net and click your profile
token_file=token.txt

[phantom]
address = 127.0.0.1:8080
rps_schedule = const(1,1m) ; load scheme
header_http = 1.1
headers = [Host: yandex.ru] [Cookies: None] [Connection: close]
uris = /
15:29:30 [INFO] Detected target: 127.0.0.1
15:29:30 [INFO] Exception: Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/yandextank/core/consoleworker.py", line 275, in perform_test
    self.core.plugins_start_test()
  File "/usr/lib/python2.7/site-packages/yandextank/core/tankcore.py", line 245, in plugins_start_test
    plugin.start_test()
  File "/usr/lib/python2.7/site-packages/yandextank/plugins/Overload/plugin.py", line 199, in start_test
    loadscheme, detailed_field, self.notify_list)
  File "/usr/lib/python2.7/site-packages/yandextank/plugins/Overload/client.py", line 96, in new_job
    "api/job/create.json?api_token=" + self.api_token, data)
  File "/usr/lib/python2.7/site-packages/yandextank/plugins/Overload/client.py", line 71, in post
    resp = self.session.send(prepared, timeout=self.api_timeout)
  File "/usr/lib/python2.7/site-packages/requests/sessions.py", line 609, in send
    r = adapter.send(request, **kwargs)
  File "/usr/lib/python2.7/site-packages/requests/adapters.py", line 487, in send
    raise ConnectionError(e, request=request)
ConnectionError: HTTPSConnectionPool(host='overload.yandex.net', port=443): Max retries exceeded with url: /api/job/create.json?api_token=<...> (Caused by NewConnectionError('<requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x3c1ba90>: Failed to establish a new connection: [Errno 111] Connection refused',))

Tcpdump shows that yandex-tank trying to connect to ip adress of overload.yandex.net

c13 commented 7 years ago

If you want to send proxy variable to the tank just add -e HTTPS_PROXY=http://ip:port/ to docker run command. For example: docker run -v $(pwd):/var/loadtest -v $HOME/.ssh:/root/.ssh -e HTTPS_PROXY=http://192.168.1.1:8080/ --net host -it direvius/yandex-tank

doctornkz commented 7 years ago

I think, you totally broke it again after Overload --> Datauploader migration.