~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/blackbox/test_serve.py

  • Committer: John Arbash Meinel
  • Date: 2011-09-15 12:56:23 UTC
  • mto: (6133.4.49 2.5-soft-hangup-795025)
  • mto: This revision was merged to the branch mainline in revision 6170.
  • Revision ID: john@arbash-meinel.com-20110915125623-sxo3jk6d858alyzf
Expose --client-timeout to the command line, pass it through the layers.

Show diffs side-by-side

added added

removed removed

Lines of Context:
286
286
        # Now, we wait for timeout to trigger
287
287
        self.assertServerFinishesCleanly(process)
288
288
 
 
289
    def test_bzr_serve_supports_client_timeout(self):
 
290
        process, url = self.start_server_port(['--client-timeout=0.1'])
 
291
        self.build_tree_contents([('a_file', 'contents\n')])
 
292
        # We can connect and issue a request
 
293
        t = transport.get_transport_from_url(url)
 
294
        self.assertEqual('contents\n', t.get_bytes())
 
295
        # However, if we just wait for more content from the server, it will
 
296
        # eventually disconnect us.
 
297
        # TODO: Use something like signal.alarm() so that if the server doesn't
 
298
        #       properly handle the timeout, we end up failing the test instead
 
299
        #       of hanging forever.
 
300
        m = t.get_smart_medium()
 
301
        m.read_bytes()
 
302
        # Now, we wait for timeout to trigger
 
303
        self.assertServerFinishesCleanly(process)
 
304
 
289
305
 
290
306
class TestCmdServeChrooting(TestBzrServeBase):
291
307