Merge lp:~jelmer/brz/flaky-server into lp:brz

Proposed by Jelmer Vernooij
Status: Merged
Approved by: Jelmer Vernooij
Approved revision: no longer in the source branch.
Merge reported by: The Breezy Bot
Merged at revision: not available
Proposed branch: lp:~jelmer/brz/flaky-server
Merge into: lp:brz
Diff against target: 75 lines (+7/-7)
5 files modified
breezy/bzr/smart/ping.py (+1/-1)
breezy/tests/blackbox/test_serve.py (+3/-3)
breezy/tests/test_smart_signals.py (+2/-2)
python3.flapping (+0/-1)
python3.passing (+1/-0)
To merge this branch: bzr merge lp:~jelmer/brz/flaky-server
Reviewer Review Type Date Requested Status
Martin Packman Approve
Review via email: mp+352724@code.launchpad.net

Commit message

Fix a racy TCP server test.

Description of the change

Fix racy TCP server test.

To post a comment you must log in.
Revision history for this message
Martin Packman (gz) wrote :

Thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'breezy/bzr/smart/ping.py'
2--- breezy/bzr/smart/ping.py 2018-07-22 17:06:14 +0000
3+++ breezy/bzr/smart/ping.py 2018-08-08 02:23:30 +0000
4@@ -47,7 +47,7 @@
5 client = _SmartClient(medium)
6 # Use call_expecting_body (even though we don't expect a body) so that
7 # we can see the response headers (if any) via the handler object.
8- response, handler = client.call_expecting_body('hello')
9+ response, handler = client.call_expecting_body(b'hello')
10 handler.cancel_read_body()
11 self.outf.write('Response: %r\n' % (response,))
12 if getattr(handler, 'headers', None) is not None:
13
14=== modified file 'breezy/tests/blackbox/test_serve.py'
15--- breezy/tests/blackbox/test_serve.py 2018-07-07 15:06:42 +0000
16+++ breezy/tests/blackbox/test_serve.py 2018-08-08 02:23:30 +0000
17@@ -322,7 +322,7 @@
18 m = t.get_smart_medium()
19 c = client._SmartClient(m)
20 # Start, but don't finish a response
21- resp, response_handler = c.call_expecting_body('get', 'bigfile')
22+ resp, response_handler = c.call_expecting_body(b'get', b'bigfile')
23 self.assertEqual((b'ok',), resp)
24 # Note: process.send_signal is a Python 2.6ism
25 process.send_signal(signal.SIGHUP)
26@@ -331,8 +331,8 @@
27 # request to finish
28 self.assertEqual(b'Requested to stop gracefully\n',
29 process.stderr.readline())
30- self.assertEqual(b'Waiting for 1 client(s) to finish\n',
31- process.stderr.readline())
32+ self.assertIn(process.stderr.readline(),
33+ (b'', b'Waiting for 1 client(s) to finish\n'))
34 body = response_handler.read_body_bytes()
35 if body != big_contents:
36 self.fail('Failed to properly read the contents of "bigfile"')
37
38=== modified file 'breezy/tests/test_smart_signals.py'
39--- breezy/tests/test_smart_signals.py 2018-05-13 02:18:13 +0000
40+++ breezy/tests/test_smart_signals.py 2018-08-08 02:23:30 +0000
41@@ -175,8 +175,8 @@
42 client_medium = medium.SmartSimplePipesClientMedium(client_read,
43 client_write, 'base')
44 client_client = client._SmartClient(client_medium)
45- resp, response_handler = client_client.call_expecting_body('get',
46- 'bigfile')
47+ resp, response_handler = client_client.call_expecting_body(b'get',
48+ b'bigfile')
49 signals._sighup_handler(SIGHUP, None)
50 self.assertTrue(factory.smart_server.finished)
51 # We can still finish reading the file content, but more than that, and
52
53=== modified file 'python3.flapping'
54--- python3.flapping 2018-08-07 20:43:32 +0000
55+++ python3.flapping 2018-08-08 02:23:30 +0000
56@@ -11,7 +11,6 @@
57 breezy.tests.blackbox.test_shared_repository.TestSharedRepo.test_init_repo_without_username
58 breezy.tests.blackbox.test_shared_repository.TestSharedRepo.test_make_repository
59 breezy.tests.blackbox.test_shared_repository.TestSharedRepo.test_make_repository_quiet
60-breezy.tests.test_smart_transport.TestSmartTCPServer.test_graceful_shutdown_waits_for_clients_to_stop
61 breezy.plugins.git.tests.test_remote.FetchFromRemoteToBzrTests.test_sprout_with_annotated_tag
62 breezy.plugins.git.tests.test_remote.FetchFromRemoteToGitTests.test_sprout_with_annotated_tag
63 breezy.plugins.git.tests.test_remote.RemoteControlDirTests.test_annotated_tag
64
65=== modified file 'python3.passing'
66--- python3.passing 2018-08-07 20:43:32 +0000
67+++ python3.passing 2018-08-08 02:23:30 +0000
68@@ -28915,6 +28915,7 @@
69 breezy.tests.test_smart_transport.TestSmartServerStreamMedium.test_socket_wait_for_bytes_with_timeout_no_data
70 breezy.tests.test_smart_transport.TestSmartServerStreamMedium.test_socket_wait_for_bytes_with_timeout_with_data
71 breezy.tests.test_smart_transport.TestSmartTCPServer.test_get_error_unexpected
72+breezy.tests.test_smart_transport.TestSmartTCPServer.test_graceful_shutdown_waits_for_clients_to_stop
73 breezy.tests.test_smart_transport.TestSmartTCPServer.test_propagates_timeout
74 breezy.tests.test_smart_transport.TestSmartTCPServer.test_serve_closes_out_finished_connections
75 breezy.tests.test_smart_transport.TestSmartTCPServer.test_serve_conn_tracks_connections

Subscribers

People subscribed via source and target branches