Dmitrijs Ledkovs has proposed merging lp:~xnox/upstart/fix-qemu-test into 
lp:upstart.

Requested reviews:
  James Hunt (jamesodhunt)

For more details, see:
https://code.launchpad.net/~xnox/upstart/fix-qemu-test/+merge/137512

Originally the race was noticed in the Ubuntu Cloud image booted in qemu as 
part of autopkgtest runner.

Waiting for the pid of the test job, makes this race evident on my local host 
as well.

At first, I have tried to do the log checks in the pid greater than zero 
branch, but at that time the log was not written yet, hence I moved it later @ 
the test clean up. I am not sure how correct this is.

With this change & stgrabers initctl2dot merge fix, the autopkgtest pass as run 
in the jenkins environment.

-
v2 Applied review comments.
-- 
https://code.launchpad.net/~xnox/upstart/fix-qemu-test/+merge/137512
Your team Upstart Reviewers is subscribed to branch lp:upstart.
=== modified file 'init/tests/test_job_process.c'
--- init/tests/test_job_process.c	2012-11-26 14:04:27 +0000
+++ init/tests/test_job_process.c	2012-12-03 09:52:22 +0000
@@ -4787,11 +4787,21 @@
 			assert0 (unlink (script));
 		} else {
 			TEST_GT (pid, 0);
+			TEST_EQ (waitpid (pid, &status, 0), pid);
 		}
 
 		TEST_ALLOC_SAFE {
 			/* May alloc space if there is log data */
 			nih_free (class);
+			if (!test_alloc_failed) {
+				TEST_GT (sprintf (filename, "%s/simple-test.log", dirname), 0);
+				output = fopen (filename, "r");
+				TEST_NE_P (output, NULL);
+				CHECK_FILE_EQ (output, "hello world\r\n", TRUE);
+				TEST_FILE_END (output);
+				TEST_EQ (fclose (output), 0);
+			}
+			unlink (filename);
 		}
 	}
 

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

Reply via email to