2 from foolscap.logging.incident import IncidentQualifier
3 class NonQualifier(IncidentQualifier):
4 def check_event(self, ev):
7 def disable_foolscap_incidents():
8 # Foolscap-0.2.9 (at least) uses "trailing delay" in its default incident
9 # reporter: after a severe log event is recorded (thus triggering an
10 # "incident" in which recent events are dumped to a file), a few seconds
11 # of subsequent events are also recorded in the incident file. The timer
12 # that this leaves running will cause "Unclean Reactor" unit test
13 # failures. The simplest workaround is to disable this timer. Note that
14 # this disables the timer for the entire process: do not call this from
15 # regular runtime code; only use it for unit tests that are running under
17 #IncidentReporter.TRAILING_DELAY = None
19 # Also, using Incidents more than doubles the test time. So we just
20 # disable them entirely.
21 from foolscap.logging.log import theLogger
23 theLogger.setIncidentQualifier(iq)
25 # we disable incident reporting for all unit tests.
26 disable_foolscap_incidents()
29 if sys.platform == "win32":
30 from allmydata.windows.fixups import initialize