diff options
| author | Joshua Watt <JPEWhacker@gmail.com> | 2024-10-10 08:59:55 -0600 |
|---|---|---|
| committer | Steve Sakoman <steve@sakoman.com> | 2024-10-10 12:01:06 -0700 |
| commit | 270a77853cfb5f0914fac7719e972414121db8a7 (patch) | |
| tree | 484c7cfec3d3abea4b176d9534fce99dbcdfbf3c /bitbake/lib | |
| parent | 8b08aecc806492ca7628d532c07e7d7c5f4b5358 (diff) | |
| download | poky-270a77853cfb5f0914fac7719e972414121db8a7.tar.gz | |
bitbake: hashserv: tests: Omit client in slow server start test
On Fedora 39 and Fedora 40 hosts, this version of the hash server
exhibits different behavior on exit when using Unix Domain sockets.
Instead of closing the client connections and exiting immediately, the
server will wait until all clients have disconnected before exiting. It
is unknown why this changed, or why it only affects Unix Domain sockets
and not TCP sockets.
Because of this behavior change, the Slow Server Start test is failing
on these hosts. This test is primarily concerned with ensuring that the
server will actually exit, even if it gets a termination signal before
it enters its main loop, and doesn't really care about clients. As such,
modify the test so that a client is not pre-connected to the server.
This allows the server to actually exit so that the test can verify the
signal behavior.
The latest version of the hash equivalence server (on master) does not
exhibit this behavior. Speculation is that the more standardized usage
of asyncio allows the server to properly exit, even if clients are still
connected. Regardless, this patch is only intended for the older
versions, and should not be applied to master
(Bitbake rev: eb5c1ce6b1b8f33535ff7b9263ec7648044163ea)
Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Diffstat (limited to 'bitbake/lib')
| -rw-r--r-- | bitbake/lib/hashserv/tests.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/bitbake/lib/hashserv/tests.py b/bitbake/lib/hashserv/tests.py index f6b85aed85..07e1c30a33 100644 --- a/bitbake/lib/hashserv/tests.py +++ b/bitbake/lib/hashserv/tests.py | |||
| @@ -30,7 +30,7 @@ class HashEquivalenceTestSetup(object): | |||
| 30 | 30 | ||
| 31 | server_index = 0 | 31 | server_index = 0 |
| 32 | 32 | ||
| 33 | def start_server(self, dbpath=None, upstream=None, read_only=False, prefunc=server_prefunc): | 33 | def start_server(self, dbpath=None, upstream=None, read_only=False, prefunc=server_prefunc, need_client=True): |
| 34 | self.server_index += 1 | 34 | self.server_index += 1 |
| 35 | if dbpath is None: | 35 | if dbpath is None: |
| 36 | dbpath = os.path.join(self.temp_dir.name, "db%d.sqlite" % self.server_index) | 36 | dbpath = os.path.join(self.temp_dir.name, "db%d.sqlite" % self.server_index) |
| @@ -54,8 +54,11 @@ class HashEquivalenceTestSetup(object): | |||
| 54 | def cleanup_client(client): | 54 | def cleanup_client(client): |
| 55 | client.close() | 55 | client.close() |
| 56 | 56 | ||
| 57 | client = create_client(server.address) | 57 | if need_client: |
| 58 | self.addCleanup(cleanup_client, client) | 58 | client = create_client(server.address) |
| 59 | self.addCleanup(cleanup_client, client) | ||
| 60 | else: | ||
| 61 | client = None | ||
| 59 | 62 | ||
| 60 | return (client, server) | 63 | return (client, server) |
| 61 | 64 | ||
| @@ -341,7 +344,7 @@ class HashEquivalenceCommonTests(object): | |||
| 341 | old_signal = signal.signal(signal.SIGTERM, do_nothing) | 344 | old_signal = signal.signal(signal.SIGTERM, do_nothing) |
| 342 | self.addCleanup(signal.signal, signal.SIGTERM, old_signal) | 345 | self.addCleanup(signal.signal, signal.SIGTERM, old_signal) |
| 343 | 346 | ||
| 344 | _, server = self.start_server(prefunc=prefunc) | 347 | _, server = self.start_server(prefunc=prefunc, need_client=False) |
| 345 | server.process.terminate() | 348 | server.process.terminate() |
| 346 | time.sleep(30) | 349 | time.sleep(30) |
| 347 | event.set() | 350 | event.set() |
