~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Patch Queue Manager
  • Date: 2012-08-23 14:24:38 UTC
  • mfrom: (6499.3.13 832042-shared-stores)
  • Revision ID: pqm@pqm.ubuntu.com-20120823142438-804xd3yql622ahhp
(vila) Share and cache local config files (Vincent Ladeuil)

Show diffs side-by-side

added added

removed removed

Lines of Context:
274
274
    def test_bzr_serve_supports_configurable_timeout(self):
275
275
        gs = config.GlobalStack()
276
276
        gs.set('serve.client_timeout', 0.2)
 
277
        # Save the config as the subprocess will use it
 
278
        gs.store.save()
277
279
        process, url = self.start_server_port()
278
280
        self.build_tree_contents([('a_file', 'contents\n')])
279
281
        # We can connect and issue a request
281
283
        self.assertEqual('contents\n', t.get_bytes('a_file'))
282
284
        # However, if we just wait for more content from the server, it will
283
285
        # eventually disconnect us.
284
 
        # TODO: Use something like signal.alarm() so that if the server doesn't
285
 
        #       properly handle the timeout, we end up failing the test instead
286
 
        #       of hanging forever.
287
286
        m = t.get_smart_medium()
288
287
        m.read_bytes(1)
289
288
        # Now, we wait for timeout to trigger