The cancellable may be cancelled just after the operation succeeds in a
different thread. So instead of checking whether the cancellable is
cancelled, check whether the operation returned a CANCELLED
error, and
then assert that the cancellable is cancelled.
This should fix https://pwithnall.pages.gitlab.gnome.org/-/glib/-/jobs/2338552/artifacts/_build/meson-logs/testlog.txt:
ok 1 /unix-streams/basic
Bail out! GLib-GIO:ERROR:../gio/tests/unix-streams.c:149:main_thread_skipped: assertion failed (err == (g-io-error-quark, 19)): err is NULL
stderr:
Signed-off-by: Philip Withnall pwithnall@endlessos.org