From 96caca2b7ab8d75b161f9c18736a4e9985cdc20e Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Mon, 14 Mar 2022 16:37:41 +0000 Subject: [PATCH] tests: Explicitly close stream in converter-stream MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When the test has finished writing all the expanded content into the socket, explicitly close the output stream, which should make the input stream readable and non-blocking. The code intended to do this before, but only as a side-effect of dropping its last reference to `right`. If another reference was being held to `right` somewhere else, it wouldn’t end up being closed, which would lead to failures like https://gitlab.gnome.org/GNOME/glib/-/jobs/1890000: ``` (/var/tmp/gitlab_runner/builds/Ff4WDDRj/0/GNOME/glib/_build/gio/tests/converter-stream:56570): GLib-GIO-DEBUG: 12:56:23.280: GSocketClient: Connection successful! Bail out! GLib-GIO:ERROR:../gio/tests/converter-stream.c:1042:test_converter_pollable: assertion failed (error == NULL): Resource temporarily unavailable (g-io-error-quark, 27) stderr: ``` This is a bit of a guess (I’m not sure it’ll fix the intermittent test error, as I haven’t been able to reproduce that locally), but it’s worth a try. Signed-off-by: Philip Withnall --- gio/tests/converter-stream.c | 1 + 1 file changed, 1 insertion(+) diff --git a/gio/tests/converter-stream.c b/gio/tests/converter-stream.c index b23436d8f..31399a78e 100644 --- a/gio/tests/converter-stream.c +++ b/gio/tests/converter-stream.c @@ -1017,6 +1017,7 @@ test_converter_pollable (void) } else if (socket_out) { + g_output_stream_close (socket_out, NULL, NULL); g_object_unref (right); socket_out = NULL; }