]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commit
test/common.py: fix race condition waiting for the helper connection
authorBrian Warner <warner@lothar.com>
Thu, 14 Jun 2012 19:17:55 +0000 (12:17 -0700)
committerBrian Warner <warner@lothar.com>
Thu, 14 Jun 2012 19:18:35 +0000 (12:18 -0700)
commitb2dcbbb62dc759d47c643bea4fae440180055d8d
tree13f71a15cac3cbdbd980531978648ef0c367ff75
parentdaa24bce8b61e25bd0839c8baed4f0772585f904
test/common.py: fix race condition waiting for the helper connection

The wait_for_connections() method, which is used at the start of
test_system to make sure that all the clients are connected to all the
servers, did not also wait for clients to be connected to their Helpers.
Every once in a while, the helper connection would take a bit longer,
and then
test_system.SystemTest.test_filesystem._test_web._got_welcome_helper
would fail, because we'd check for a helper connection before it was
ready.

The fix is to modify wait_for_connections's polling predicate to look
for helper connections (if configured) as well as the regular
introducer- and server- connections.

Tested by temporarily adding a large (30s) delay to the connectTo() call
in Uploader.startService, simulating a long helper
connection-establishment delay. This makes the test fail consistently.
Then I fixed wait_for_connections(), and the test passed (slowly). Then
I removed the delay.

Closes #1467
src/allmydata/test/common.py