Ticket #2937 (closed enhancement: fixed )

Opened 2 years ago

Last modified 2 years ago

parameterize reactor in twisted.application.internet services

Reported by: exarkun Assigned to: therve
Type: enhancement Priority: highest
Milestone: Component: core
Keywords: Cc: therve
Branch: branches/service-reactor-2937 Author: therve
Launchpad Bug:

Description

The unpleasant way ports are bound and connections are made by the internet services means that it is difficult or impossible to test this code without actually hitting the network. This is likewise for application code (such as makeService implementations) which creates these objects.

It should be possible to specify the reactor used by these classes.

Attachments

Change History

  2007-12-09 11:16:07+00:00 changed by therve

  • branch set to branches/service-reactor-2937
  • author set to therve

(In [22037]) Branching to 'service-reactor-2937'

  2007-12-09 11:18:45+00:00 changed by therve

(In [22038]) Make reactor parametrizable in clients and servers.

Refs #2937

  2007-12-09 11:24:05+00:00 changed by therve

  • cc set to therve
  • keywords set to review
  • owner deleted
  • priority changed from normal to highest

This is ready to review!

  2007-12-09 21:18:47+00:00 changed by exarkun

  • keywords deleted
  • owner set to therve

The implementations of _getPort and _getConnection won't work as expected the second time they're invoked (eg, startService, stopService, startService).

I guess there should be some test coverage for the repeated use of the same service object.

  2007-12-10 08:16:34+00:00 changed by therve

(In [22051]) Remove the 'reactor' keyword in init, add tests for multiple start, some docs.

Refs #2937

  2007-12-10 08:25:58+00:00 changed by therve

  • keywords set to review
  • owner deleted

Oups, thanks, I had missed that. Back to review.

  2007-12-28 05:02:34+00:00 changed by exarkun

  • keywords deleted
  • owner set to therve

pyflakes warnings on test_application.py:

  • twisted/test/test_application.py:20: 'microdom' imported but unused
  • twisted/test/test_application.py:591: redefinition of fuction 'test_reactorParametrizationInClient' from line 553

_getPort and _getConnection could probably use some docstrings.

Other than those issues, I think it looks good. No need for re-review unless you notice something else.

  2007-12-28 12:11:21+00:00 changed by therve

(In [22161]) Rename a test, add some docstrings to internal methods.

Refs #2937

  2007-12-28 12:31:14+00:00 changed by therve

  • status changed from new to closed
  • resolution set to fixed

(In [22163]) Merge service-reactor-2937

Author: therve Reviewer: exarkun Fixes #2937

Add a reactor keyword for services in twisted.application.internet so that we can test this code more easily without hitting the network.

Note: See TracTickets for help on using tickets.