#2808 closed enhancement (fixed)

scan for defer.setDebugging(True)

Reported by: warner Owned by: warner
Priority: normal Milestone: 1.12.0
Component: code Version: 1.11.0
Keywords: Cc:
Launchpad Bug:

Description

While investigating problems, we frequently turn on defer.setDebugging(True) temporarily. This records stack traces inside Deferreds (both the trace leading up to creation, and the one leading up to the first callback/errback invocation).

Unfortunately this slows things down considerably, and sometimes we forget to turn this back off before committing new code. I think we've done this three or four times so far. The most recent time was a few weeks ago, when the magic-folders code landed with Deferred debugging turned on. Meejah just noticed it and fixed it in [054efe0] today.

We should write some automated test that scans the codebase for defer.setDebugging(True) and flunks the tests if it's found. Something in the code-checks run, the one where we look for duplicate umid values, or mis-captured local variables, or pyflakes failures.

Change History (6)

comment:1 Changed at 2016-08-19T17:17:52Z by meejah

Simpson suggested just a simple grep -R .setDebugging(True) is probably sufficient ... and likely less wonky than my only other idea of "monkeypatch setDebugging, then import everything".

comment:3 Changed at 2016-08-20T00:03:37Z by warner

  • Milestone changed from eventually to 1.12.0
  • Owner set to warner
  • Status changed from new to assigned

Awesome.. thanks! I've got a branch somewhere that adds the code-checks target to tox.. I'll close this when I get that landed too.

comment:4 Changed at 2016-08-20T01:06:05Z by warner

  • Resolution set to fixed
  • Status changed from assigned to closed

Landed in [85cf1d65]. I had to rewrite the grep command in python, to run it under tox. But now each travis job runs the full suite of code-checks.

comment:5 Changed at 2016-08-22T18:40:36Z by meejah

Couldn't we just have added "make code-checks" to the "script" list in .travis.yml?

comment:6 Changed at 2016-08-23T05:49:22Z by warner

Travis could do that, but I don't think appveyor could (no /usr/bin/make on windows), and I think Tox is the best "official" thing to recommend, and tox doesn't like to do non-python things (there's no way to declare a dependency on Make). Yeah, I'm kinda annoyed by it too :). But Zooko convinced me a while ago to stop adding new Makefile targets, so I've been slowly moving things over to tox instead.

Note: See TracTickets for help on using tickets.