sometimes selftest hang on win32

John Arbash Meinel john at arbash-meinel.com
Thu Jan 4 20:13:06 GMT 2007


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

Alexander Belchenko wrote:
> bzr.dev revno.2204
> selftest hangs on test_lockdir.TestLockDir.test_35_wait_lock_changing
> 
> stderr show me this traceback:
> 
...

> But running this test alone I don't have this traceback.
> 
> D:\Bazaar\sandbox\regression>python bzr --no-plugins selftest test_lockdir.TestLockDir.test_35_wait_lock_changing -v
>        bzr: D:/Bazaar/sandbox/regression/bzr
>     bzrlib: D:\Bazaar\sandbox\regression\bzrlib
> 
> running 1 tests...
> test_lockdir.TestLockDir.test_35_wait_lock_changing                                                  OK
> 401ms
> 
> ----------------------------------------------------------------------
> Ran 1 test in 0.451s
> 
> OK
> tests passed
> 
> 
> Because there is used multiple threads I think problem
> caused by some sort of racing conditions.
> Note: too many similar errors I have with SFTP tests on win32.
> 
> Alexander


For some of the other tests I used locks to avoid race conditions.

Something like this usually works:

barrier1 = threading.Lock()
barrier1.acquire() # Start out locked

def thread():
  foo.something()
  # Once the work is done, break the barrier
  barrier1.unlock()

t = threading.Thread(target=thread)
t.start()
barrier1.acquire() # Wait until the thread has done its work.
barrier1.unlock()

Something like that.

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

iD8DBQFFnV/SJdeBCYSNAAMRAuLkAJ9kLVsF4NOXnbgVa++ZTdYQR/92FACfW6dH
leZ4lKeoS0UvLYAozprA++M=
=eSpY
-----END PGP SIGNATURE-----



More information about the bazaar mailing list