[Twisted-Python] Ticket Hall of Shame - Current Loser: Brian Warner

Jean-Paul Calderone exarkun at divmod.com
Fri Jan 12 13:00:31 MST 2007

On Fri, 12 Jan 2007 10:54:10 -0800, Scott Lamb <slamb at slamb.org> wrote:
>On Jan 12, 2007, at 9:28 AM, Itamar Shtull-Trauring wrote:
>>It's worth submitting fixes even if you don't attach a test, better  than
>>no bug report at all. But we must have tests, whether written by
>>submitter or Twisted developer, to actually commit a patch. Without
>>tests we have no way of knowing:
>>1. whether a bug actually exists,
>>2. whether the patch fixes it, or
>>3. whether the patch introduces new bugs.
>What about race conditions? I ran into such a problem a while back in  code 
>using reactor.spawnProcess - seeing if it is a twisted bug and  if it's 
>valid in current versions is on my todo list, but the  priority is low 
>because of the insistence on having a test for  everything. I like spending 
>my time on things I can actually get fixed.
>Say I find it is a still-valid twisted bug. What am I supposed to do?
>(1) create a test that likely fails by running many, many times. It'd  bog 
>down the test suite.
>(2) create a test that might fail sometime, maybe.
>(3) add instrumentation to the main code solely for the purpose of  the test 
>(break twisted's kneecap before the race).
>(4) just say "clearly[*] if event A happens between lines X and Y,  then it 
>is handled improperly."
>I prefer #4.

I think this actually varies from case to case.  For a problem where all
of the relevant critical points cannot be hooked or mocked or stubbed or
what have you, then a combination of #2 and #4 seems correct to me.  You
should be able to demonstrate that a real problem does exist by adding a
test which will fail eventually when run repeatedly (eg, using trial -u)
and which runs for orders of magnitude longer without failing once a fix
has been applied.

Always feel free to file the ticket before figuring any of this out, by
the way.  It is still possible that it will strike someone else's fancy
and the rest of the work will be taken care of for you. :)

>[*] Of course, this word is a big lie that we inflict on people  because 
>others have done it to us. As one of my favorite physics  professors would 
>say, "clearly" means "be careful here".



More information about the Twisted-Python mailing list