[RFH] bzr 2.1.0rc + scmproj selftest: "attempt to escape test isolation". What should I do?

John Arbash Meinel john at arbash-meinel.com
Tue Jan 26 08:01:03 GMT 2010


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Alexander Belchenko wrote:
> Dear bzr devs,
> 
> Can you have some docs or exampples of how I should port my tests in
> scmproj plugin to be compatible with both bzr 2.1.0rc1 and bzr 2.0? I
> have 5 failures and all of them are about "Attempt to escape test
> isolation".
> 
> Thanks
> Alexander

Generally that is caused by trying to 'open' a branch which is not
created by the test suite (such as your original working tree). We added
it as a sign of tests that were not properly isolating themselves.

I don't know what you are testing, you may be trying to open the scmproj
workspace itself?

There appears to be a few options:

1) TestCase now has a "_directory_isolation" attribute, which can be
turned on and off with "enable_directory_isolation()" and
"disable_directory_isolation()". If you are worried about version skew,
you could either do

 getattr(self, 'disable_directory_isolation', lambda:None)()

Or just
 self._directory_isolation = False
If we don't support that flag, it won't do anything, if we do, it will
disable it. Though future changes may invalidate it.

2) Change the test to not open branches that aren't underneath the test
case runner.

3) Call TestCase.permit_url() for the branches you are accessing. This
also would require a getattr() check for older bzr's that don't have the
function.

...

I'm sure there is more, but I don't know it.

John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkteoT8ACgkQJdeBCYSNAAMxwwCguxxlhMm3FQVhzWOvtga587hP
N8gAoI+p5Jg4gSerxSo5IjcYZD/M1E+O
=qPiY
-----END PGP SIGNATURE-----



More information about the bazaar mailing list