tahoe-lafs/src/allmydata
Kevan Carstensen 81ad52d6eb Change OphandleTable to use a deterministic clock, so we can test it
To test the changes for #577, we need a deterministic way to simulate
the passage of long periods of time. twisted.internet.task.Clock seems,
from my Googling, to be the way to go for this functionality. I changed
a few things so that OphandleTable would use twisted.internet.task.Clock
when testing:

  * WebishServer.__init___ now takes an optional 'clock' parameter,
  * which it passes to the root.Root instance it creates.
  * root.Root.__init__ now takes an optional 'clock' parameter, which it
    passes to the OphandleTable.__init__ method.
  * OphandleTable.__init__ now takes an optional 'clock' parameter. If
    it is provided, and it isn't None, its callLater method will be used
    to schedule ophandle expirations (as opposed to using
    reactor.callLater, which is what OphandleTable does normally).
  * The WebMixin object in test_web.py now sets a self.clock parameter,
    which is a twisted.internet.task.Clock that it feeds to the 
    WebishServer it creates. 

Tests using the WebMixin can control the passage of time in
OphandleTable by accessing self.clock.
2010-02-20 13:07:13 -08:00
..
frontends Use if instead of assert to check for twisted ftp patch 2010-01-26 17:55:29 -08:00
gui switch all foolscap imports to use foolscap.api or foolscap.logging 2009-05-21 17:38:23 -07:00
immutable immutable: downloader accepts notifications of buckets even if those notifications arrive after he has begun downloading shares. 2010-01-31 22:16:10 -08:00
introducer remove introducer/old.py, will create something similar when the RIIntroducer changes 2009-06-24 12:40:38 -07:00
mutable Prevent mutable objects from being retrieved from an immutable directory, and associated forward-compatibility improvements. 2010-01-26 22:44:30 -08:00
scripts Alter CLI utilities to handle nonexistent aliases better 2010-02-10 18:43:18 -08:00
storage hush pyflakes-0.4.0 warnings: remove trivial unused variables. For #900. 2010-01-14 14:15:29 -08:00
test Change OphandleTable to use a deterministic clock, so we can test it 2010-02-20 13:07:13 -08:00
util Fix race conditions and missing callback in allmydata.test.test_cli.Cp.test_copy_using_filecap, add utilities for one-liner reading and writing of files, and fix cases in test_cli where files were not being closed after writing. 2010-02-05 17:37:27 -08:00
web Change OphandleTable to use a deterministic clock, so we can test it 2010-02-20 13:07:13 -08:00
windows move registry module into allmydata.windows package 2008-01-10 19:03:23 -07:00
__init__.py cli: suppress DeprecationWarnings emitted from importing nevow and twisted. Fixes #859 2010-01-31 16:44:29 -08:00
check_results.py naming: finish renaming "CheckerResults" to "CheckResults" 2009-01-09 18:00:52 -07:00
client.py Prevent mutable objects from being retrieved from an immutable directory, and associated forward-compatibility improvements. 2010-01-26 22:44:30 -08:00
codec.py download: refactor handling of URI Extension Block and crypttext hash tree, simplify things 2008-12-05 08:17:54 -07:00
control.py Prevent mutable objects from being retrieved from an immutable directory, and associated forward-compatibility improvements. 2010-01-26 22:44:30 -08:00
debugshell.py finish storage server and write new download 2007-03-30 10:52:19 -07:00
dirnode.py Address comments by Kevan on 833 and add test for stripping spaces 2010-01-27 15:06:42 -08:00
hashtree.py hashtree.py: another micro-optimization, expand on a comment 2009-04-03 21:35:27 -07:00
history.py stop making History be a Service, it wasn't necessary 2009-08-15 04:44:15 -07:00
interfaces.py Miscellaneous documentation, test, and code formatting tweaks. 2010-01-26 23:03:09 -08:00
key_generator.py switch to using RemoteException instead of 'wrapped' RemoteReferences. Should fix #653, the rref-EQ problem 2009-05-21 17:46:32 -07:00
manhole.py trailing-whitespace eradication, no functional changes 2007-11-01 15:22:41 -07:00
monitor.py monitor: update interface definition: get_status() can return a Failure 2008-11-06 21:54:52 -07:00
node.py node.py/interfaces.py: minor docs fixes 2009-12-29 15:04:09 -08:00
nodemaker.py Eliminate 'foo if test else bar' syntax that isn't supported by Python 2.4 2010-01-28 19:52:10 -08:00
provisioning.py hush pyflakes-0.4.0 warnings: remove trivial unused variables. For #900. 2010-01-14 14:15:29 -08:00
reliability.py hush pyflakes-0.4.0 warnings: remove trivial unused variables. For #900. 2010-01-14 14:15:29 -08:00
stats.py tidy up DeadReferenceError handling, ignore them in add_lease calls 2010-01-11 16:07:23 -08:00
storage_client.py more #859: avoid deprecation warning for unit tests too, hush pyflakes 2009-12-14 16:01:47 -08:00
unknown.py Add mutable field to t=json output for unknown nodes, when mutability is known 2010-01-28 19:14:24 -08:00
uri.py Miscellaneous documentation, test, and code formatting tweaks. 2010-01-26 23:03:09 -08:00
webish.py Change OphandleTable to use a deterministic clock, so we can test it 2010-02-20 13:07:13 -08:00