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

Check for junk in the main reactor in the tearDown of each test #287

Open
adiroiban opened this issue Jan 15, 2020 · 1 comment
Open

Check for junk in the main reactor in the tearDown of each test #287

adiroiban opened this issue Jan 15, 2020 · 1 comment

Comments

@adiroiban
Copy link

This is an issue I found in txacme..

There was a test not using AsynchronousDeferredRunTest but using the main reactor and it left the reactor dirty...

Then, another test was executed with AsynchronousDeferredRunTest and the main reactor. This test was fine, but test were still failing as it was now detecting that reactor is not clean.

I think that in twistedsuppor there should be a dedicated TestCase to check for junk at tearDown for the main reactor

Also, I think that besides delayedcalls, readers and writers and threads should also be considered junk

For my projects I am using a simplified TwistedTestCase on top of stdlib TestCase and here is the reactor cleanup check that I use:

https://github.com/chevah/compat/blob/master/chevah/compat/testing/testcase.py#L310

@adiroiban
Copy link
Author

Here is my fix for txacme to help detect "drity" tests.

I guess that this is a common patter in all Twisted tests and we might have something like this in testtools

twisted/txacme@1a49fcb

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

No branches or pull requests

1 participant