~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_server.py

  • Committer: Vincent Ladeuil
  • Date: 2010-06-30 15:19:36 UTC
  • mto: (5247.6.7 http-leaks)
  • mto: This revision was merged to the branch mainline in revision 5396.
  • Revision ID: v.ladeuil+lp@free.fr-20100630151936-bwh082le0i52p8ez
Fixed as per jam's review.

* bzrlib/tests/test_server.py:
* bzrlib/tests/test_http.py:
* bzrlib/tests/http_server.py:
* bzrlib/tests/ftp_server/pyftpdlib_based.py:
* bzrlib/tests/ftp_server/medusa_based.py:
Use sys.stderr.write() rather than print for thread dbugging trace.

* bzrlib/osutils.py:
(connect_socket): Remove the timeout parameter.

Show diffs side-by-side

added added

removed removed

Lines of Context:
506
506
        t.start()
507
507
        started.wait()
508
508
        if debug_threads():
509
 
            print 'Client thread %s started' % (t.name,)
 
509
            sys.stderr.write('Client thread %s started\n' % (t.name,))
510
510
        # If an exception occured during the thread start, it will get raised.
511
511
        t.pending_exception()
512
512
 
521
521
            # shutdown. If an exception occurred in the thread it will be
522
522
            # re-raised
523
523
            if debug_threads():
524
 
                print 'Client thread %s will be joined' % (
525
 
                    connection_thread.name,)
 
524
                sys.stderr.write('Client thread %s will be joined\n'
 
525
                                 % (connection_thread.name,))
526
526
            connection_thread.join()
527
527
 
528
528
    def set_ignored_exceptions(self, thread, ignored_exceptions):
569
569
        self.server_address = self.server.server_address
570
570
        self._server_thread.name = self.server.server_address
571
571
        if debug_threads():
572
 
            print 'Server thread %s started' % (self._server_thread.name,)
 
572
            sys.stderr.write('Server thread %s started\n'
 
573
                             % (self._server_thread.name,))
573
574
        # If an exception occured during the server start, it will get raised,
574
575
        # otherwise, the server is blocked on its accept() call.
575
576
        self._server_thread.pending_exception()
591
592
                self.server.ignored_exceptions_during_shutdown)
592
593
            self.server.serving.clear()
593
594
            if debug_threads():
594
 
                print 'Server thread %s will be joined' % (
595
 
                    self._server_thread.name,)
 
595
                sys.stderr.write('Server thread %s will be joined\n'
 
596
                                 % (self._server_thread.name,))
596
597
            # The server is listening for a last connection, let's give it:
597
598
            last_conn = None
598
599
            try: