Skip to content

tests: Fix race condition on cancellation in unix-streams test

Philip Withnall requested to merge pwithnall/glib:unix-streams-fixes into main

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

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

Signed-off-by: Philip Withnall

Merge request reports