Skip to content

RequestTraversalAgent: Pass reactor to Site - #225

Merged
glyph merged 1 commit into
twisted:masterfrom
twm:requesttraversalagent-clock
Jul 7, 2018
Merged

glyph merged 1 commit into
twisted:masterfrom
twm:requesttraversalagent-clock

Conversation

@twm

@twm twm commented Jul 5, 2018

Copy link
Copy Markdown
Member

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

codecov Bot commented Jul 5, 2018 •

Copy link
Copy Markdown

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

glyph commented Jul 7, 2018

Copy link
Copy Markdown
Member

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