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

RequestTraversalAgent: Pass reactor to Site #225

Merged
merged 1 commit into from
Jul 7, 2018

Conversation

twm
Copy link
Contributor

@twm twm commented Jul 5, 2018

RequestTraversalAgent constructed a MemoryReactor for I/O, but didn't pass it to the Site it constructs, so the Site would create delayed calls in the global reactor. This pull request changes the MemoryReactor to a MemoryReactorClock and passes it to the Site.

See also twisted/twisted#1037 which clarifies the purpose of the HTTPFactory (Site superclass) reactor argument.

@codecov
Copy link

codecov bot commented Jul 5, 2018

Codecov Report

Merging #225 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #225      +/-   ##
==========================================
+ Coverage   98.86%   98.86%   +<.01%     
==========================================
  Files          26       26              
  Lines        2281     2282       +1     
  Branches      164      164              
==========================================
+ Hits         2255     2256       +1     
  Misses         14       14              
  Partials       12       12
Impacted Files Coverage Δ
src/treq/testing.py 100% <100%> (ø) ⬆️

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 973c969...8d956eb. Read the comment docs.

@glyph glyph merged commit 0041d5d into twisted:master Jul 7, 2018
@glyph
Copy link
Member

glyph commented Jul 7, 2018

Looks unambiguously correct to me. Thanks!

@twm twm deleted the requesttraversalagent-clock branch July 8, 2018 02:23
twm added a commit to twm/yarrharr that referenced this pull request Jul 9, 2018
This prevents a real reactor from being initialized in the Django test
runner. I'm hiding this behind an environment variable for now because
of a treq issue; see twisted/treq#225
twm added a commit to twm/yarrharr that referenced this pull request Jul 9, 2018
Pull in twisted/treq#225.

Leave the poison reactor disabled due to twisted/treq#226.
twm added a commit to twm/treq that referenced this pull request Mar 15, 2020
bmwiedemann referenced this pull request in bmwiedemann/openSUSE Mar 25, 2020
https://build.opensuse.org/request/show/788271
by user scarabeus_iv + dimstar_suse
- version update to 20.3.0
  - Python 3.7 support. (`#228 <https://github.com/twisted/treq/issues/228>`__)
  - `treq.testing.RequestTraversalAgent` now passes its memory reactor to the `twisted.web.server.Site` it creates, preventing the ``Site`` from polluting the global reactor. (`#225 <https://github.com/twisted/treq/issues/225>`__)
  - `treq.testing` no longer generates deprecation warnings about ``twisted.test.proto_helpers.MemoryReactor``. (`#253 <https://github.com/twisted/treq/issues/253>`__)
  - The ``download_file.py`` example has been updated to do a streaming download with *unbuffered=True*. (`#233 <https://github.com/twisted/treq/issues/233>`__)
  - The *agent* parameter to `treq.request()` has been documented. (`#235 <https://github.com/twisted/treq/issues/235>`__)
  - The typ
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