Ticket #5521 defect closed fixed

Opened 14 months ago

Last modified 10 months ago

Many ReactorBuilder-style tests in twisted.internet.test do not declare their reactor requirements via requiredInterfaces

Reported by: exarkun Owned by: exarkun
Priority: normal Milestone:
Component: core Keywords: tests
Cc: micahel@… Branch: branches/better-test-declarations-5521
Author: exarkun Launchpad Bug:

Description

ReactorBuilder.requiredInterfaces exists to allow tests which require a particular reactor interface to be skipped when an attempt is made to run those tests against a reactor which does not support that interface.

However, many of our tests (for TCP, for UNIX, for UDP, for time) do not use this feature and will still try to run against a reactor that does not provided the necessary interface.

Attachments

required-interfaces.patch Download (5.6 KB) - added by exarkun 14 months ago.

Change History

Changed 14 months ago by exarkun

1

Changed 14 months ago by exarkun

Attached is a patch that fixes the instances of this that I found. I didn't pay particularly close attention when constructing it, I just added requirements as quick as I could to get the tests to skip against my reactor that is missing most interfaces.

2

Changed 10 months ago by exarkun

  • status changed from new to assigned
  • owner set to exarkun

3

Changed 10 months ago by exarkun

  • branch set to branches/better-test-declarations-5521
  • branch_author set to exarkun

(In [34734]) Branching to 'better-test-declarations-5521'

4

Changed 10 months ago by exarkun

(In [34735]) Declare that IReactorTCP is required by these test cases. Also, re-wrap docstrings to 80 columns and unify the IPv6 skip definitions.

refs #5521

5

Changed 10 months ago by exarkun

(In [34736]) Make all the necessary declarations for these

refs #5521

6

Changed 10 months ago by exarkun

(In [34737]) The same thing for IReactorTime

refs #5521

7

Changed 10 months ago by exarkun

(In [34739]) I feel as though I've been here before.

refs #5521

8

Changed 10 months ago by exarkun

(In [34742]) This is redundant now, I think

refs #5521

9

Changed 10 months ago by exarkun

  • status changed from assigned to new
  • owner exarkun deleted
  • keywords review added

Just what you'd expect, but overlooked before because every existing reactor already implemented all of these interfaces and no one developed new reactors very TDDly.  Build results.

10

Changed 10 months ago by mwh

  • owner set to exarkun
  • keywords review removed
  • cc micahel@… added

This seems fine to me, although I have no way of verifying that it works. It certainly looks like it should :-) I don't understand the

if ipv6Skip:
    skip = ipv6Skip

construction, isn't that equivalent to plain skip = ipv6Skip. If you have a good reason for that, and you're sure the few failures in buildbot are unrelated (they certainly look unrelated to me), please merge.

11

Changed 10 months ago by exarkun

isn't that equivalent to plain skip = ipv6Skip

Sadly it is not. A class-level skip = None is different than not having a class-level skip attribute at all. It's terrible, and probably represents a bug or misfeature in trial to be fixed.

12

Changed 10 months ago by exarkun

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

(In [34751]) Merge better-test-declarations-5521

Author: exarkun Reviewer: mwhudson Fixes: #5521

Make sure to declare which reactor interfaces are required by various ReactorBuilder-style tests.

Note: See TracTickets for help on using tickets.