testing/mozbase/mozprocess/tests/test_mozprocess_kill_broad_wait.py

changeset 0
6474c204b198
equal deleted inserted replaced
-1:000000000000 0:da0b6378f44d
1 #!/usr/bin/env python
2
3 import os
4 import time
5 import unittest
6 import proctest
7 from mozprocess import processhandler
8
9 here = os.path.dirname(os.path.abspath(__file__))
10
11 class ProcTestKill(proctest.ProcTest):
12 """ Class to test various process tree killing scenatios """
13
14 # This test should ideally be a part of test_mozprocess_kill.py
15 # It has been separated for the purpose of tempporarily disabling it.
16 # See https://bugzilla.mozilla.org/show_bug.cgi?id=921632
17 def test_process_kill_broad_wait(self):
18 """Process is started, we use a broad process tree, we let it spawn
19 for a bit, we kill it"""
20
21 p = processhandler.ProcessHandler([self.python, self.proclaunch, "process_normal_broad_python.ini"],
22 cwd=here)
23 p.run()
24 # Let the tree spawn a bit, before attempting to kill
25 time.sleep(3)
26 p.kill()
27
28 detected, output = proctest.check_for_process(self.proclaunch)
29 self.determine_status(detected,
30 output,
31 p.proc.returncode,
32 p.didTimeout,
33 expectedfail=('returncode',))
34
35 if __name__ == '__main__':
36 unittest.main()

mercurial