They make everything a lot harder to reason about, and easily allow for
state to leak between tests.
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
The output pointer must not go past the ending \0.
warning: HEAP[testglib.exe]:
warning: Heap block at 0000011EA35745A0 modified at 0000011EA35745BF past requested size of f
Fixes commit 9a30a495ec3 "gfileutils: Improve performance of g_canonicalize_filename()"
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
It’s a tradeoff of time against reproducibility of the failure conditions
this test is testing for. If this test is run 100× on CI (which it will
be every few weeks), that should be often enough to catch a regression
here.
A regression in this code is unlikely, though.
This change is motivated by the fact that periodically this test times
out, and even when it doesn’t, it takes on average 240s of CI runner
time during each CI run. That’s a lot of resources.
See: https://gitlab.gnome.org/GNOME/glib/-/jobs/1862013
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
As well as with `EACCES`. This can happen if the filesystem as a whole
is read-only, and has been spotted in the wild on macOS:
```
Bail out! GLib:ERROR:../glib/tests/fileutils.c:756:test_mkdir_with_parents: assertion failed (errno == EACCES): (1 == 13)
stderr:
**
GLib:ERROR:../glib/tests/fileutils.c:756:test_mkdir_with_parents: assertion failed (errno == EACCES): (1 == 13)
```
See: https://stackoverflow.com/q/68766316/2931197
See: https://gitlab.gnome.org/GNOME/glib/-/jobs/1866500
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
When calling `g_main_loop_run()` it’s possible for a reference to the
`GMainLoop` to leak if this thread had to wait to acquire ownership of
the `GMainContext`.
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
Fixes: #2598
Replace all instances of ensure_valid_builder or ensure_valid_dict
calls used as arguments to the g_return_if_fail or
g_return_value_if_fail macros with otherwise equivalent code that
always calls these functions, thus ensuring their side effects always
apply. This commit does not change any external or private interfaces.
Fixes#2612
Meson generates a gdbinit file that will automatically load glib and
gobject scripts. However that script uses a helper python module that
needs PYTHONPATH to be pointing into the right location in the source
tree to be able to find glib_gdb.py and gobject_gdb.py
Manipulating PATH the way the test does, it breaks DLL lookups and fails
to run helper programs.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
I haven't been able to write a reproducer yet and report the bug to
Microsoft, but this is 100% crashing when running "meson test
gsubprocess"
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Add test-spawn-sleep helper program to sleep on Windows (child-test
removed in commit 241b9f41b, probably breaking the test)
(fwiw, Windows has a timeout command nowadays, but it conflicts with
msys2 timeout which has different usage)
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Test failures were previously ignored on macOS because there are 12
tests which consistently fail (and have not yet been fixed, because
there are no regularly active macOS maintainers for GLib; you could help
here!).
However, this means that new test failures can’t be spotted.
So, explicitly mark those 12 tests as `should_fail` on macOS, and then
make other test failures cause failure of the CI run.
We can track the process of fixing those 12 tests on #1392 and #1251.
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
Helps: #1392
The source needs to be removed from the `GMainContext` before being
unreffed, otherwise the main context and main loop will be kept around.
Signed-off-by: Philip Withnall <pwithnall@endlessos.org>