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

update geventhttpclient #796

Closed
wants to merge 51 commits into from
Closed

update geventhttpclient #796

wants to merge 51 commits into from

Conversation

ityoung
Copy link

@ityoung ityoung commented May 16, 2018

I create an issue #795 before, and found that can be merge straightly with no conflict.. awkward >_<

hope to be merged. @heyman

DeepHorizons and others added 30 commits September 20, 2017 14:44
if a TaskSet has an `on_stop` method, it will be run before the proccess
exits. It will also look for a property on the class named
`always_run_on_stop`, which if True will run regardless if the
`on_start` method finished.
This should also take care of the greenlets
We want to make sure order is perserved
They were used in a previous commit, but are not used any more
Removed always_run_on_stop variable as it is no longer used
Adding unit to Response Time chart
update README with http urls
Adds support for setup, teardown, and on_stop methods
As locust no longer support Python 2.6, there is no need to install
unittest2. The unittest shipped with the Python 2.7+ stdlib is the same
as unittest2.

Results in fewer dependencies and slightly faster installation during
testing.

Python 2.6 support was removed in version 0.8.
Wheels are the new standard of python distribution. Advantages of wheels
includes:

- Faster installation
- Avoids arbitrary code execution for installation by avoiding setup.py
- Allows better caching for testing and continuous integration
- Creates .pyc files as part of installation to ensure they match the
  python interpreter used
- More consistent installs across platforms and machines

As locust is a pure Python package (no C files) for both Python 2 & 3,
the wheel can be distributed as universal.

When you wouldd normally run `python setup.py sdist upload`, run instead
`python setup.py sdist bdist_wheel upload`.

The wheel includes the LICENSE file through the [metadata] attribute
license_file.

For additional information on Python wheels, see:

https://pythonwheels.com/

For the detailed PEP, see:

https://www.python.org/dev/peps/pep-0427/
Slightly speed up builds and reduce load on PyPI servers.

For more information, see:

https://docs.travis-ci.com/user/caching/#pip-cache
response.content is a byte string. It should be compared against other
byte strings. To examine the response content as text, use the
response.text attribute.

Fixes warnings when Python is passed the -b argument (Issue warnings
about str(bytes_instance), str(bytearray_instance) and comparing
bytes/bytearray with str.)

  BytesWarning: str() on a bytes instance

For additional information on the -b argument, see:

https://docs.python.org/3/using/cmdline.html#cmdoption-b

For additional information on response.text, see:

http://docs.python-requests.org/en/master/api/#requests.Response.text
The dependency pyzmq is already listed in setup.py. Tox will install all package
dependencies by default. The dependencies do not need to be respecified
in tox.ini. Remove the redundant dependency specification.
The environment variables, CI TRAVIS TRAVIS_* TOXENV, do not influence
locust nor its tests. Keep the tox configuration minimal by excluding
them. Avoids any future unexpected differences between CI and local test
runs.
cgoldberg and others added 12 commits April 8, 2018 15:35
drop unitt2 and use tox in 'make test' target
* [docs] crank up maxdepth for the index page

* [docs] move changelog to the end
Docs: update test statistics page with example responses
Added user-defined wait_function to locust and TaskSet. Fixes #18.
Introduce **kwargs to request_success/failure parameter list
Support for Python 2.6 was previously removed from Locust.  This removes the leftover compatibility workarounds that were put in place for Python 2.6's outdated unittest module.
@ityoung
Copy link
Author

ityoung commented May 17, 2018

@heyman Hi, I merged this on my own PC and using FastHttpLocut to replace HttpLocust, it runs fast but, when I use with keyword try to set a checkpoint, the response.content(orresponse.text) is always an empty bytearray(b'').

        with self.client.get(my_url, catch_response=True) as response:
            res = response.content
            response.failure(res)    # use this failure to output response.content

And if I use HttpLocust with with keyword, it response exactly what I expect.

And, when I'm not using with keyword, both of FastHttpLocust and HttpLocust work perfectly.

        res = self.client.get(my_url).text
        assert len(res) == 32, res    # use this to output response.text

You may check the code of safe_mode(request with catch_response=True), I suspect that it may be unfinished of the request? I check the source code, but I really didn't know much about geventhttpclient. Hope you can help!

@codecov
Copy link

codecov bot commented May 20, 2018

Codecov Report

Merging #796 into geventhttpclient will decrease coverage by 2.53%.
The diff coverage is 54.23%.

Impacted file tree graph

@@                 Coverage Diff                 @@
##           geventhttpclient    #796      +/-   ##
===================================================
- Coverage             68.63%   66.1%   -2.54%     
===================================================
  Files                    15      14       -1     
  Lines                  1540    1422     -118     
  Branches                233     224       -9     
===================================================
- Hits                   1057     940     -117     
- Misses                  429     431       +2     
+ Partials                 54      51       -3
Impacted Files Coverage Δ
locust/main.py 26.16% <0%> (-0.5%) ⬇️
locust/clients.py 96.62% <100%> (+7.86%) ⬆️
locust/stats.py 78.35% <100%> (ø) ⬆️
locust/runners.py 51.31% <50%> (ø) ⬆️
locust/core.py 82.5% <57.14%> (-5.33%) ⬇️
locust/contrib/fasthttp.py

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 40aebc6...61b43c7. Read the comment docs.

mbeacom added 2 commits May 20, 2018 15:32
docs: Syntax highlight code and commands
Distribute package as a universal wheel
@cgoldberg
Copy link
Member

Our workflow has generally used Pull Requests to merge into master, not for merging master onto other dev branches on behalf of someone else... so this PR kinda confused me.

@heyman can you update your geventhttpclient branch with latest from master? (either via this PR or just merging your local and pushing directly)

@ityoung for reference, we have #713 open for merging the geventhttpclient branch to master once ready.

@ityoung
Copy link
Author

ityoung commented May 21, 2018

@cgoldberg Yes I found #713 , and I found the branch geventhttpclient hasn't been update for 2 month, so I raise this PR. Thanks for telling me the usage of PR, I might need to give a issue instead, right?

@heyman I have merged from master on my local computer, and found some problem, hope you can fix that, it's a real good work!

ps-george and others added 5 commits May 28, 2018 10:18
* Removing py33 from tox; no longer supported by TravisCI

* Removing py33 from Travis conf; no longer supported

* Change unsupported wsgi to pywsgi

* Remove reference to Python 3.3, no longer supported.
@ityoung ityoung closed this Jun 15, 2018
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.