~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_server.py

  • Committer: John Arbash Meinel
  • Date: 2011-10-03 08:15:39 UTC
  • mto: This revision was merged to the branch mainline in revision 6186.
  • Revision ID: john@arbash-meinel.com-20111003081539-ondt7hnvoec1jg8o
Suppress ConnectionTimeout as a server-side exception.

Make sure that if we get a 'shutdown' request while we are waiting on an idle
connection, this won't generate an exception as part of handling the request.

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
 
25
25
from bzrlib import (
26
26
    cethread,
 
27
    errors,
27
28
    osutils,
28
29
    transport,
29
30
    urlutils,
605
606
                                                 server)
606
607
 
607
608
    def handle(self):
608
 
        while not self.finished:
609
 
            server_protocol = self._build_protocol()
610
 
            self._serve_one_request(server_protocol)
 
609
        try:
 
610
            while not self.finished:
 
611
                server_protocol = self._build_protocol()
 
612
                self._serve_one_request(server_protocol)
 
613
        except errors.ConnectionTimeout:
 
614
            # idle connections aren't considered a failure of the server
 
615
            return
611
616
 
612
617
 
613
618
_DEFAULT_TESTING_CLIENT_TIMEOUT = 4.0