~torkvemada/bzr/commit_hooks

« back to all changes in this revision

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

  • Committer: Vsevolod Velichko
  • Date: 2012-10-02 12:35:15 UTC
  • mfrom: (6538.1.29 +trunk)
  • Revision ID: torkvema@gmail.com-20121002123515-4lao1ci5m1bvsg7a
Merge with trunk

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