mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-08-01 11:26:52 +03:00
tests/pkd: relax pthread_kill assert in pkd_stop
Relax the `pthread_kill` result assertion in `pkd_stop` to tolerate
`ESRCH`, and guard against only `EINVAL` and `ENOTSUP`.
On macOS what can happen is that the `pthread_kill` returns `ESRCH` due
to the accept thread being already terminated. For that case, the
teardown path should proceed to `pthread_join`.
Testing notes:
- On my macOS setup I consistently encountered `ESRCH` in this
codepath, causing pkd tests to fail unnecessarily. With the
change, I observe the tests passing.
Signed-off-by: Jon Simons <jon@jonsimons.org>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
(cherry picked from commit aa206cbfe5
)
This commit is contained in:
@ -589,7 +589,8 @@ void pkd_stop(struct pkd_result *out) {
|
||||
close(pkd_state.server_fd);
|
||||
|
||||
rc = pthread_kill(ctx.tid, SIGUSR1);
|
||||
assert_int_equal(rc, 0);
|
||||
assert_int_not_equal(rc, EINVAL);
|
||||
assert_int_not_equal(rc, ENOTSUP);
|
||||
|
||||
rc = pthread_join(ctx.tid, NULL);
|
||||
assert_int_equal(rc, 0);
|
||||
|
Reference in New Issue
Block a user