diff options
author | Joshua Watt <JPEWhacker@gmail.com> | 2020-06-25 09:21:07 -0500 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-06-28 08:36:56 +0100 |
commit | 07a02b31fd80748ab11d7e30fbf2a3d2e59b1426 (patch) | |
tree | 6e7cc522bdf2374cdcd726faa7c5199bf883a5c1 /bitbake/lib/hashserv/tests.py | |
parent | b3f212d6bc43936d54f330372625456dad4c570a (diff) | |
download | poky-07a02b31fd80748ab11d7e30fbf2a3d2e59b1426.tar.gz |
bitbake: hashserv: Chunkify large messages
The hash equivalence client and server can occasionally send messages
that are too large for the server to fit in the receive buffer (64 KB).
To prevent this, support is added to the protocol to "chunkify" the
stream and break it up into manageable pieces that the server can each
side can back together.
Ideally, this would be negotiated by the client and server, but it's
currently hard coded to 32 KB to prevent the round-trip delay.
(Bitbake rev: e27a28c1e40e886ee68ba4b99b537ffc9c3577d4)
Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/hashserv/tests.py')
-rw-r--r-- | bitbake/lib/hashserv/tests.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/bitbake/lib/hashserv/tests.py b/bitbake/lib/hashserv/tests.py index a5472a996d..6e86295079 100644 --- a/bitbake/lib/hashserv/tests.py +++ b/bitbake/lib/hashserv/tests.py | |||
@@ -99,6 +99,29 @@ class TestHashEquivalenceServer(object): | |||
99 | result = self.client.get_unihash(self.METHOD, taskhash) | 99 | result = self.client.get_unihash(self.METHOD, taskhash) |
100 | self.assertEqual(result, unihash) | 100 | self.assertEqual(result, unihash) |
101 | 101 | ||
102 | def test_huge_message(self): | ||
103 | # Simple test that hashes can be created | ||
104 | taskhash = 'c665584ee6817aa99edfc77a44dd853828279370' | ||
105 | outhash = '3c979c3db45c569f51ab7626a4651074be3a9d11a84b1db076f5b14f7d39db44' | ||
106 | unihash = '90e9bc1d1f094c51824adca7f8ea79a048d68824' | ||
107 | |||
108 | result = self.client.get_unihash(self.METHOD, taskhash) | ||
109 | self.assertIsNone(result, msg='Found unexpected task, %r' % result) | ||
110 | |||
111 | siginfo = "0" * (self.client.max_chunk * 4) | ||
112 | |||
113 | result = self.client.report_unihash(taskhash, self.METHOD, outhash, unihash, { | ||
114 | 'outhash_siginfo': siginfo | ||
115 | }) | ||
116 | self.assertEqual(result['unihash'], unihash, 'Server returned bad unihash') | ||
117 | |||
118 | result = self.client.get_taskhash(self.METHOD, taskhash, True) | ||
119 | self.assertEqual(result['taskhash'], taskhash) | ||
120 | self.assertEqual(result['unihash'], unihash) | ||
121 | self.assertEqual(result['method'], self.METHOD) | ||
122 | self.assertEqual(result['outhash'], outhash) | ||
123 | self.assertEqual(result['outhash_siginfo'], siginfo) | ||
124 | |||
102 | def test_stress(self): | 125 | def test_stress(self): |
103 | def query_server(failures): | 126 | def query_server(failures): |
104 | client = Client(self.server.address) | 127 | client = Client(self.server.address) |