sysdeps test: Wait for spawned process to exit

On Windows, the "out" parameter for the process handle isn't set
unless we specify G_SPAWN_FLAGS_DO_NOT_REAP_CHILD. That means we
can't terminate it, and the child process is leaked. When running the
test individually, the leaked process is harmless apart from its
resource cost, but when running under CTest, it holds a file descriptor
open (or something) which causes CTest to not exit.

If we *do* specify G_SPAWN_FLAGS_DO_NOT_REAP_CHILD, we become
responsible for "reaping" the child process by waiting for its exit
status, which is an OS-specific action.

Signed-off-by: Simon McVittie <smcv@collabora.com>
Resolves: dbus/dbus#238
12 jobs for sysdeps-test-wait in 37 seconds (queued for 10 minutes and 17 seconds)
Status Job ID Name Coverage
  Build
manual #56822
allowed to fail manual
build:buster
failed #56816
build:cmake

00:00:05

failed #56813
build:debug

00:00:05

manual #56818
allowed to fail manual
build:i686-w64-mingw32-cmake
failed #56817
build:i686-w64-mingw32-debug

00:00:06

manual #56821
allowed to fail manual
build:jessie
manual #56815
allowed to fail manual
build:legacy
failed #56812
build:production

00:00:08

manual #56814
allowed to fail manual
build:reduced
failed #56819
build:x86_64-w64-mingw32

00:00:05

failed #56820
build:x86_64-w64-mingw32-cmake-debug

00:00:05

manual #56823
allowed to fail manual
build:xenial
 
Name Stage Failure
failed
build:x86_64-w64-mingw32-cmake-debug Build
Using Docker executor with image debian:stretch-slim ...
Pulling docker image debian:stretch-slim ...
Using docker image sha256:e9e49a465debc413cfb3b8a9dfb979e99dd28962d4966027ec4a232c0a840342 for debian:stretch-slim ...
Running on runner-81280d8f-project-1208-concurrent-0 via fdo-gitlab-gce-runner3...
Fetching changes...
HEAD is now at 8a3d733d CI: Install yelp-tools, for yelp-build, in recent distros
Checking out 7db89148 as sysdeps-test-wait...
fatal: reference is not a tree: 7db891482f045f81441869eff8ac662b1cc1a7b4
ERROR: Job failed: exit code 1
failed
build:x86_64-w64-mingw32 Build
Using Docker executor with image debian:stretch-slim ...
Pulling docker image debian:stretch-slim ...
Using docker image sha256:e9e49a465debc413cfb3b8a9dfb979e99dd28962d4966027ec4a232c0a840342 for debian:stretch-slim ...
Running on runner-81280d8f-project-1208-concurrent-0 via fdo-gitlab-gce-runner3...
Fetching changes...
HEAD is now at 8a3d733d CI: Install yelp-tools, for yelp-build, in recent distros
Checking out 7db89148 as sysdeps-test-wait...
fatal: reference is not a tree: 7db891482f045f81441869eff8ac662b1cc1a7b4
ERROR: Job failed: exit code 1
failed
build:i686-w64-mingw32-debug Build
Using Docker executor with image debian:stretch-slim ...
Pulling docker image debian:stretch-slim ...
Using docker image sha256:e9e49a465debc413cfb3b8a9dfb979e99dd28962d4966027ec4a232c0a840342 for debian:stretch-slim ...
Running on runner-81280d8f-project-1208-concurrent-0 via fdo-gitlab-gce-runner3...
Fetching changes...
HEAD is now at 8a3d733d CI: Install yelp-tools, for yelp-build, in recent distros
Checking out 7db89148 as sysdeps-test-wait...
fatal: reference is not a tree: 7db891482f045f81441869eff8ac662b1cc1a7b4
ERROR: Job failed: exit code 1
failed
build:cmake Build
Using Docker executor with image debian:stretch-slim ...
Pulling docker image debian:stretch-slim ...
Using docker image sha256:e9e49a465debc413cfb3b8a9dfb979e99dd28962d4966027ec4a232c0a840342 for debian:stretch-slim ...
Running on runner-81280d8f-project-1208-concurrent-0 via fdo-gitlab-gce-runner3...
Fetching changes...
HEAD is now at 8a3d733d CI: Install yelp-tools, for yelp-build, in recent distros
Checking out 7db89148 as sysdeps-test-wait...
fatal: reference is not a tree: 7db891482f045f81441869eff8ac662b1cc1a7b4
ERROR: Job failed: exit code 1
failed
build:debug Build
Using Docker executor with image debian:stretch-slim ...
Pulling docker image debian:stretch-slim ...
Using docker image sha256:e9e49a465debc413cfb3b8a9dfb979e99dd28962d4966027ec4a232c0a840342 for debian:stretch-slim ...
Running on runner-81280d8f-project-1208-concurrent-0 via fdo-gitlab-gce-runner3...
Fetching changes...
HEAD is now at 8a3d733d CI: Install yelp-tools, for yelp-build, in recent distros
Checking out 7db89148 as sysdeps-test-wait...
fatal: reference is not a tree: 7db891482f045f81441869eff8ac662b1cc1a7b4
ERROR: Job failed: exit code 1
failed
build:production Build
Removing m4/ltversion.m4
Removing m4/lt~obsolete.m4
Removing test/Makefile.in
Removing test/name-test/Makefile.in
Removing tools/Makefile.in
HEAD is now at 8a3d733d CI: Install yelp-tools, for yelp-build, in recent distros
Checking out 7db89148 as sysdeps-test-wait...
fatal: reference is not a tree: 7db891482f045f81441869eff8ac662b1cc1a7b4
ERROR: Job failed: exit code 1