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
=== modified file 'breezy/bzr/smart/ping.py'
--- breezy/bzr/smart/ping.py 2018-07-22 17:06:14 +0000
+++ breezy/bzr/smart/ping.py 2018-08-08 02:23:30 +0000
@@ -47,7 +47,7 @@
47 client = _SmartClient(medium)47 client = _SmartClient(medium)
48 # Use call_expecting_body (even though we don't expect a body) so that48 # Use call_expecting_body (even though we don't expect a body) so that
49 # we can see the response headers (if any) via the handler object.49 # we can see the response headers (if any) via the handler object.
50 response, handler = client.call_expecting_body('hello')50 response, handler = client.call_expecting_body(b'hello')
51 handler.cancel_read_body()51 handler.cancel_read_body()
52 self.outf.write('Response: %r\n' % (response,))52 self.outf.write('Response: %r\n' % (response,))
53 if getattr(handler, 'headers', None) is not None:53 if getattr(handler, 'headers', None) is not None:
5454
=== modified file 'breezy/tests/blackbox/test_serve.py'
--- breezy/tests/blackbox/test_serve.py 2018-07-07 15:06:42 +0000
+++ breezy/tests/blackbox/test_serve.py 2018-08-08 02:23:30 +0000
@@ -322,7 +322,7 @@
322 m = t.get_smart_medium()322 m = t.get_smart_medium()
323 c = client._SmartClient(m)323 c = client._SmartClient(m)
324 # Start, but don't finish a response324 # Start, but don't finish a response
325 resp, response_handler = c.call_expecting_body('get', 'bigfile')325 resp, response_handler = c.call_expecting_body(b'get', b'bigfile')
326 self.assertEqual((b'ok',), resp)326 self.assertEqual((b'ok',), resp)
327 # Note: process.send_signal is a Python 2.6ism327 # Note: process.send_signal is a Python 2.6ism
328 process.send_signal(signal.SIGHUP)328 process.send_signal(signal.SIGHUP)
@@ -331,8 +331,8 @@
331 # request to finish331 # request to finish
332 self.assertEqual(b'Requested to stop gracefully\n',332 self.assertEqual(b'Requested to stop gracefully\n',
333 process.stderr.readline())333 process.stderr.readline())
334 self.assertEqual(b'Waiting for 1 client(s) to finish\n',334 self.assertIn(process.stderr.readline(),
335 process.stderr.readline())335 (b'', b'Waiting for 1 client(s) to finish\n'))
336 body = response_handler.read_body_bytes()336 body = response_handler.read_body_bytes()
337 if body != big_contents:337 if body != big_contents:
338 self.fail('Failed to properly read the contents of "bigfile"')338 self.fail('Failed to properly read the contents of "bigfile"')
339339
=== modified file 'breezy/tests/test_smart_signals.py'
--- breezy/tests/test_smart_signals.py 2018-05-13 02:18:13 +0000
+++ breezy/tests/test_smart_signals.py 2018-08-08 02:23:30 +0000
@@ -175,8 +175,8 @@
175 client_medium = medium.SmartSimplePipesClientMedium(client_read,175 client_medium = medium.SmartSimplePipesClientMedium(client_read,
176 client_write, 'base')176 client_write, 'base')
177 client_client = client._SmartClient(client_medium)177 client_client = client._SmartClient(client_medium)
178 resp, response_handler = client_client.call_expecting_body('get',178 resp, response_handler = client_client.call_expecting_body(b'get',
179 'bigfile')179 b'bigfile')
180 signals._sighup_handler(SIGHUP, None)180 signals._sighup_handler(SIGHUP, None)
181 self.assertTrue(factory.smart_server.finished)181 self.assertTrue(factory.smart_server.finished)
182 # We can still finish reading the file content, but more than that, and182 # We can still finish reading the file content, but more than that, and
183183
=== modified file 'python3.flapping'
--- python3.flapping 2018-08-07 20:43:32 +0000
+++ python3.flapping 2018-08-08 02:23:30 +0000
@@ -11,7 +11,6 @@
11breezy.tests.blackbox.test_shared_repository.TestSharedRepo.test_init_repo_without_username11breezy.tests.blackbox.test_shared_repository.TestSharedRepo.test_init_repo_without_username
12breezy.tests.blackbox.test_shared_repository.TestSharedRepo.test_make_repository12breezy.tests.blackbox.test_shared_repository.TestSharedRepo.test_make_repository
13breezy.tests.blackbox.test_shared_repository.TestSharedRepo.test_make_repository_quiet13breezy.tests.blackbox.test_shared_repository.TestSharedRepo.test_make_repository_quiet
14breezy.tests.test_smart_transport.TestSmartTCPServer.test_graceful_shutdown_waits_for_clients_to_stop
15breezy.plugins.git.tests.test_remote.FetchFromRemoteToBzrTests.test_sprout_with_annotated_tag14breezy.plugins.git.tests.test_remote.FetchFromRemoteToBzrTests.test_sprout_with_annotated_tag
16breezy.plugins.git.tests.test_remote.FetchFromRemoteToGitTests.test_sprout_with_annotated_tag15breezy.plugins.git.tests.test_remote.FetchFromRemoteToGitTests.test_sprout_with_annotated_tag
17breezy.plugins.git.tests.test_remote.RemoteControlDirTests.test_annotated_tag16breezy.plugins.git.tests.test_remote.RemoteControlDirTests.test_annotated_tag
1817
=== modified file 'python3.passing'
--- python3.passing 2018-08-07 20:43:32 +0000
+++ python3.passing 2018-08-08 02:23:30 +0000
@@ -28915,6 +28915,7 @@
28915breezy.tests.test_smart_transport.TestSmartServerStreamMedium.test_socket_wait_for_bytes_with_timeout_no_data28915breezy.tests.test_smart_transport.TestSmartServerStreamMedium.test_socket_wait_for_bytes_with_timeout_no_data
28916breezy.tests.test_smart_transport.TestSmartServerStreamMedium.test_socket_wait_for_bytes_with_timeout_with_data28916breezy.tests.test_smart_transport.TestSmartServerStreamMedium.test_socket_wait_for_bytes_with_timeout_with_data
28917breezy.tests.test_smart_transport.TestSmartTCPServer.test_get_error_unexpected28917breezy.tests.test_smart_transport.TestSmartTCPServer.test_get_error_unexpected
28918breezy.tests.test_smart_transport.TestSmartTCPServer.test_graceful_shutdown_waits_for_clients_to_stop
28918breezy.tests.test_smart_transport.TestSmartTCPServer.test_propagates_timeout28919breezy.tests.test_smart_transport.TestSmartTCPServer.test_propagates_timeout
28919breezy.tests.test_smart_transport.TestSmartTCPServer.test_serve_closes_out_finished_connections28920breezy.tests.test_smart_transport.TestSmartTCPServer.test_serve_closes_out_finished_connections
28920breezy.tests.test_smart_transport.TestSmartTCPServer.test_serve_conn_tracks_connections28921breezy.tests.test_smart_transport.TestSmartTCPServer.test_serve_conn_tracks_connections

Subscribers

People subscribed via source and target branches