tests: Remove an incorrect assertion in converter-stream

While the assertion always turned out to be true on Linux, it frequently
caused spurious test failures on FreeBSD.

After some remote debugging, I *think* the cause is as written up in the
comment in the code in this commit. However, I cannot be certain, as the
more debugging messages I added, the harder the failure was to
reproduce; and I don’t have access to a FreeBSD machine.

This fixes failures like:
```
Bail out! GLib-GIO:ERROR:../gio/tests/converter-stream.c:1043:test_converter_pollable: assertion failed (error == NULL): Resource temporarily unavailable (g-io-error-quark, 27)
```

It’s succeeded 1000 times in a row on the FreeBSD CI now; previously
it was failing one time in three:
https://gitlab.gnome.org/GNOME/glib/-/jobs/1936395.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
This commit is contained in:
Philip Withnall 2022-04-05 18:19:23 +01:00
parent 28add9abfe
commit aec5d17d77

View File

@ -1037,12 +1037,11 @@ test_converter_pollable (void)
if (!is_readable)
g_assert_cmpint (res, ==, -1);
/* After closing the write end, we can't get WOULD_BLOCK any more */
if (!socket_out)
{
g_assert_no_error (error);
g_assert_cmpint (res, !=, -1);
}
/* Even after closing the write end, we can get WOULD_BLOCK (particularly
* on FreeBSD), so we cant make any assertions based on `!socket_out`.
* This is because the FIN packets may still be in the out buffer of one
* half of the socket pair, while the in buffer of the other half has some
* data, but not enough for a full block for the converter to consume. */
if (res == -1)
{