[Merge] Slow socket
Robert Collins
robertc at robertcollins.net
Tue Aug 15 04:59:44 BST 2006
On Mon, 2006-08-14 at 12:36 -0500, John Arbash Meinel wrote:
>
> Did we decide that simulated time was better than using real time?
> (For
> one thing, async improvements would not show up properly here).
I dont think we had agreed either way.
I'm against using simulated time at the moment, because nothing else is
geared to it - and because doing it requires poking at private
variables. (naughty!) If we introduce the concept, we should do it
methodically across the timing apparatus.
> v- You could probably do this easier with a __getattr__() that thunked
> to self.sock. And explicitly blocked fileno. (My understanding is that
> __getattr__() is only called when the attribute in question fails to
> be found by the default object implementation)
I didn't use a __getattr__ because the object is not trying to be a full
socket. The problem with __getattr__ is its a very big hammer, and one
is not always sure what one hits. I support this not being __getattr__
based.
> I also think we would prefer to have a Latency adapter rather than
> using a subclass like you have done.
> That way you can run some test cases with and without latency, by just
> running the adapter over them.
What do you mean here? Adapt what to be slow ?
My thought was that the latency support would be hooked straight into
the core - into the standard SFTP test infrastructure, which my proof of
concept did. Then its a trivial flag to set to get a specific latency,
and doing test parameterisation (like working_tree implementations does)
for different latencies is easy.
I'm +0 on this at the moment:
- I'm not comfortable with simulated time at the moment
- PEP8
The use of a subclass rather than test parameterisation I can live with
- as long as time() is not being overridden - eww.
Oh, also this import
> --- bzrlib/benchmarks/__init__.py
> +++ bzrlib/benchmarks/__init__.py
> @@ -20,6 +20,7 @@
> from bzrlib import bzrdir, plugin
> from bzrlib.tests.TestUtil import TestLoader
> from bzrlib.tests.blackbox import ExternalBase
> +import bzrlib.branch
is in the wrong order - 'b' is before 'i'.
Rob
--
GPG key available at: <http://www.robertcollins.net/keys.txt>.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060815/708a3a2f/attachment.pgp
More information about the bazaar
mailing list