~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/ftp_server/pyftpdlib_based.py

Merge previous attempt into current trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
 
29
29
from bzrlib import (
30
30
    osutils,
 
31
    tests,
31
32
    trace,
32
33
    )
33
34
from bzrlib.tests import test_server
183
184
        self._ftpd_starting.acquire() # So it can be released by the server
184
185
        self._ftpd_thread = threading.Thread(target=self._run_server,)
185
186
        self._ftpd_thread.start()
 
187
        if 'threads' in tests.selftest_debug_flags:
 
188
            print 'Thread started: %s' % (self._ftpd_thread.ident,)
186
189
        # Wait for the server thread to start (i.e release the lock)
187
190
        self._ftpd_starting.acquire()
188
191
        self._ftpd_starting.release()
195
198
        self._ftp_server.close()
196
199
        self._ftpd_running = False
197
200
        self._ftpd_thread.join()
 
201
        if 'threads' in tests.selftest_debug_flags:
 
202
            print 'Thread  joined: %s' % (self._ftpd_thread.ident,)
198
203
 
199
204
    def _run_server(self):
200
205
        """Run the server until stop_server is called, shut it down properly then.