mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-01-19 03:06:33 +00:00
test_stats.py: improve test coverage
This commit is contained in:
parent
a5a7ba24ef
commit
fc774803ce
@ -8,7 +8,7 @@ class FasterMonitor(CPUUsageMonitor):
|
||||
POLL_INTERVAL = 0.1
|
||||
|
||||
|
||||
class CPUUsage(unittest.TestCase, testutil.PollMixin):
|
||||
class CPUUsage(unittest.TestCase, testutil.PollMixin, testutil.StallMixin):
|
||||
def setUp(self):
|
||||
self.s = service.MultiService()
|
||||
self.s.startService()
|
||||
@ -24,6 +24,9 @@ class CPUUsage(unittest.TestCase, testutil.PollMixin):
|
||||
def _poller():
|
||||
return bool(len(m.samples) == m.HISTORY_LENGTH+1)
|
||||
d = self.poll(_poller)
|
||||
# pause one more second, to make sure that the history-trimming code
|
||||
# is exercised
|
||||
d.addCallback(self.stall, 1.0)
|
||||
def _check(res):
|
||||
s = m.get_stats()
|
||||
self.failUnless("cpu_monitor.1min_avg" in s)
|
||||
|
Loading…
Reference in New Issue
Block a user