~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

(gz) Create working tree at specified revision when doing a local push
 (Martin Packman)

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()
279
277
        process, url = self.start_server_port()
280
278
        self.build_tree_contents([('a_file', 'contents\n')])
281
279
        # We can connect and issue a request
283
281
        self.assertEqual('contents\n', t.get_bytes('a_file'))
284
282
        # However, if we just wait for more content from the server, it will
285
283
        # 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.
286
287
        m = t.get_smart_medium()
287
288
        m.read_bytes(1)
288
289
        # Now, we wait for timeout to trigger