Merge lp:~xnox/upstart/lp1247521 into lp:upstart

Proposed by Dimitri John Ledkov
Status: Merged
Merged at revision: 1558
Proposed branch: lp:~xnox/upstart/lp1247521
Merge into: lp:upstart
Diff against target: 76 lines (+31/-2)
3 files modified
test/test_util_common.c (+18/-0)
test/test_util_common.h (+3/-0)
util/tests/test_initctl.c (+10/-2)
To merge this branch: bzr merge lp:~xnox/upstart/lp1247521
Reviewer Review Type Date Requested Status
Upstart Reviewers Pending
Review via email: mp+194045@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

select rounds up timeout based on resolution, but on some platforms precise timing is not available and hence no resolution. And then the below tests timeout. No point in measuring time, if there is no clock to measure it with.

Revision history for this message
Dimitri John Ledkov (xnox) wrote :

CLOCK_MONOTONIC_RAW is not available on Virtualised PPAs, this partially resolves FTBFS in virtualised PPAs.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== 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 @@
39#include <sys/types.h>39#include <sys/types.h>
40#include <sys/stat.h>40#include <sys/stat.h>
41#include <ctype.h>41#include <ctype.h>
42#include <time.h>
4243
43#include <nih-dbus/dbus_error.h>44#include <nih-dbus/dbus_error.h>
44#include <nih-dbus/dbus_connection.h>45#include <nih-dbus/dbus_connection.h>
@@ -269,6 +270,23 @@
269}270}
270271
271/**272/**
273 * have_timed_waitpid
274 *
275 * Return TRUE if precise timing information is available for timing
276 * tests.
277 **/
278int
279have_timed_waitpid (void)
280{
281 struct timespec res;
282
283 if (clock_getres (CLOCK_MONOTONIC_RAW, &res) < 0)
284 return FALSE;
285
286 return TRUE;
287}
288
289/**
272 * timed_waitpid:290 * timed_waitpid:
273 *291 *
274 * @pid: pid to wait for,292 * @pid: pid to wait for,
275293
=== 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 @@
692692
693void wait_for_upstart (int session_init_pid);693void wait_for_upstart (int session_init_pid);
694694
695int have_timed_waitpid (void)
696 __attribute__ ((warn_unused_result));
697
695pid_t timed_waitpid (pid_t pid, time_t timeout)698pid_t timed_waitpid (pid_t pid, time_t timeout)
696 __attribute__ ((warn_unused_result));699 __attribute__ ((warn_unused_result));
697700
698701
=== 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 @@
17090 test_job_env ();17090 test_job_env ();
17091 test_reexec ();17091 test_reexec ();
17092 test_list_sessions ();17092 test_list_sessions ();
17093 test_quiesce ();17093 if (have_timed_waitpid ()) {
17094 test_quiesce ();
17095 } else {
17096 fprintf (stderr, "\n\n"
17097 "WARNING: not running quiesce tests, "
17098 "as no precise timing information available "
17099 "\n\n");
17100 }
17101
17094 test_umask ();17102 test_umask ();
17095 test_no_dbus ();17103 test_no_dbus ();
1709617104
17097 if (in_chroot () && !dbus_configured ()) {17105 if (in_chroot () && !dbus_configured ()) {
17098 fprintf(stderr, "\n\n"17106 fprintf (stderr, "\n\n"
17099 "WARNING: not running show-config, "17107 "WARNING: not running show-config, "
17100 "check-config & notify-disk-writeable tests within chroot "17108 "check-config & notify-disk-writeable tests within chroot "
17101 "as no D-Bus, or D-Bus not configured (lp:#728988)"17109 "as no D-Bus, or D-Bus not configured (lp:#728988)"

Subscribers

People subscribed via source and target branches