def test_waittimeout(self): """
Process is started, then wait is called and times out.
Process is still running and didn't timeout """
p = processhandler.ProcessHandler(
[self.python, self.proclaunch, "process_waittimeout_10s.ini"], cwd=here
)
p.run()
p.wait(timeout=0)
self.determine_status(p, True, ())
def test_waitnotimeout(self): """Process is started, runs to completion before our wait times out"""
p = processhandler.ProcessHandler(
[self.python, self.proclaunch, "process_waittimeout_10s.ini"], cwd=here
)
p.run(timeout=30)
p.wait()
self.determine_status(p)
def test_wait_twice_after_kill(self): """Bug 968718: Process is started and stopped. wait() twice afterward."""
p = processhandler.ProcessHandler(
[self.python, self.proclaunch, "process_waittimeout.ini"], cwd=here
)
p.run()
p.kill()
returncode1 = p.wait()
returncode2 = p.wait()
self.determine_status(p)
# We killed the process, so the returncode should be non-zero if mozinfo.isWin:
self.assertGreater(
returncode2, 0, 'Positive returncode expected, got "%s"' % returncode2
) else:
self.assertLess(
returncode2, 0, 'Negative returncode expected, got "%s"' % returncode2
)
self.assertEqual(
returncode1, returncode2, "Expected both returncodes of wait() to be equal"
)
def test_wait_after_external_kill(self): """Process is killed externally, and poll() is called."""
p = processhandler.ProcessHandler(
[self.python, self.proclaunch, "process_normal_finish.ini"], cwd=here
)
p.run()
os.kill(p.pid, signal.SIGTERM)
returncode = p.wait()
# We killed the process, so the returncode should be non-zero if mozinfo.isWin:
self.assertEqual(
returncode,
signal.SIGTERM, 'Positive returncode expected, got "%s"' % returncode,
) else:
self.assertEqual(
returncode,
-signal.SIGTERM, '%s expected, got "%s"' % (-signal.SIGTERM, returncode),
)
self.assertEqual(returncode, p.poll())
self.determine_status(p)
if __name__ == "__main__":
mozunit.main()
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.18 Sekunden
(vorverarbeitet am 2026-09-06)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.