1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
|
From: Simon McVittie <smcv@debian.org>
Date: Wed, 16 Mar 2022 12:01:53 +0000
Subject: test-utils: Add more debug for starting/stopping Apache
---
tests/test-utils.c | 17 ++++++++++++++---
1 file changed, 14 insertions(+), 3 deletions(-)
diff --git a/tests/test-utils.c b/tests/test-utils.c
index bf977ed..37cd00b 100644
--- a/tests/test-utils.c
+++ b/tests/test-utils.c
@@ -237,10 +237,12 @@ apache_cmd (const char *cmd)
void
apache_init (void)
{
+ g_test_message ("[%f] enter %s", g_get_monotonic_time () / 1e6, G_STRFUNC);
+
/* Set this environment variable if you are already running a
* suitably-configured Apache server */
if (g_getenv ("SOUP_TESTS_ALREADY_RUNNING_APACHE"))
- return;
+ goto out;
server_root = soup_test_build_filename_abs (G_TEST_BUILT, "", NULL);
@@ -249,6 +251,9 @@ apache_init (void)
exit (1);
}
apache_running = TRUE;
+
+out:
+ g_test_message ("[%f] leave %s", g_get_monotonic_time () / 1e6, G_STRFUNC);
}
void
@@ -257,14 +262,18 @@ apache_cleanup (void)
pid_t pid;
char *contents;
+ g_test_message ("[%f] enter %s", g_get_monotonic_time () / 1e6, G_STRFUNC);
+
if (g_file_get_contents ("httpd.pid", &contents, NULL, NULL)) {
pid = strtoul (contents, NULL, 10);
g_free (contents);
} else
pid = 0;
- if (!apache_cmd ("graceful-stop"))
- return;
+ if (!apache_cmd ("graceful-stop")) {
+ g_printerr ("Could not stop Apache\n");
+ goto out;
+ }
apache_running = FALSE;
if (pid) {
@@ -278,6 +287,8 @@ apache_cleanup (void)
}
g_clear_pointer (&server_root, g_free);
+out:
+ g_test_message ("[%f] leave %s", g_get_monotonic_time () / 1e6, G_STRFUNC);
}
#endif /* HAVE_APACHE */
|