예제 #1
0
    def _test_getpid_fork(self):
        """
		Verify that portage.getpid() cache is updated in a forked child process.
		"""
        loop = asyncio._wrap_loop()
        proc = AsyncFunction(scheduler=loop, target=portage.getpid)
        proc.start()
        proc.wait()
        self.assertEqual(proc.pid, proc.result)
예제 #2
0
    def test_getpid_double_fork(self):
        """
		Verify that portage.getpid() cache is updated correctly after
		two forks.
		"""
        loop = asyncio._wrap_loop()
        proc = AsyncFunction(scheduler=loop, target=self._test_getpid_fork)
        proc.start()
        self.assertEqual(proc.wait(), 0)