Dmitrijs Ledkovs has proposed merging lp:~xnox/upstart/lp1247521 into 
lp:upstart.

Requested reviews:
  Upstart Reviewers (upstart-reviewers)
Related bugs:
  Bug #1247521 in upstart : "PPA unit-test failure"
  https://bugs.launchpad.net/upstart/+bug/1247521

For more details, see:
https://code.launchpad.net/~xnox/upstart/lp1247521/+merge/194045
-- 
https://code.launchpad.net/~xnox/upstart/lp1247521/+merge/194045
Your team Upstart Reviewers is requested to review the proposed merge of 
lp:~xnox/upstart/lp1247521 into lp:upstart.
=== modified file 'test/test_util_common.c'
--- test/test_util_common.c	2013-11-03 02:54:03 +0000
+++ test/test_util_common.c	2013-11-06 01:02:55 +0000
@@ -39,6 +39,7 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <ctype.h>
+#include <time.h>
 
 #include <nih-dbus/dbus_error.h>
 #include <nih-dbus/dbus_connection.h>
@@ -269,6 +270,23 @@
 }
 
 /**
+ * have_timed_waitpid
+ *
+ * Return TRUE if precise timing information is available for timing
+ * tests.
+ **/
+int
+have_timed_waitpid (void)
+{
+	struct timespec res;
+
+	if (clock_getres (CLOCK_MONOTONIC_RAW, &res) < 0)
+		return FALSE;
+
+	return TRUE;
+}
+
+/**
  * timed_waitpid:
  *
  * @pid: pid to wait for,

=== modified file 'test/test_util_common.h'
--- test/test_util_common.h	2013-10-18 09:13:36 +0000
+++ test/test_util_common.h	2013-11-06 01:02:55 +0000
@@ -692,6 +692,9 @@
 
 void wait_for_upstart (int session_init_pid);
 
+int have_timed_waitpid (void)
+	__attribute__ ((warn_unused_result));
+
 pid_t timed_waitpid (pid_t pid, time_t timeout)
 	__attribute__ ((warn_unused_result));
 

=== modified file 'util/tests/test_initctl.c'
--- util/tests/test_initctl.c	2013-11-05 16:15:19 +0000
+++ util/tests/test_initctl.c	2013-11-06 01:02:55 +0000
@@ -17090,12 +17090,20 @@
 	test_job_env ();
 	test_reexec ();
 	test_list_sessions ();
-	test_quiesce ();
+	if (have_timed_waitpid ()) {
+		test_quiesce ();
+	} else {
+		fprintf (stderr, "\n\n"
+				"WARNING: not running quiesce tests, "
+				"as no precise timing information available "
+				"\n\n");
+	}
+
 	test_umask ();
 	test_no_dbus ();
 
 	if (in_chroot () && !dbus_configured ()) {
-		fprintf(stderr, "\n\n"
+		fprintf (stderr, "\n\n"
 				"WARNING: not running show-config, "
 				"check-config & notify-disk-writeable tests within chroot "
 				"as no D-Bus, or D-Bus not configured (lp:#728988)"

-- 
upstart-devel mailing list
[email protected]
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/upstart-devel

Reply via email to