testing/mozbase/mozprocess/tests/test_mozprocess_kill_broad_wait.py

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/testing/mozbase/mozprocess/tests/test_mozprocess_kill_broad_wait.py	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,36 @@
     1.4 +#!/usr/bin/env python
     1.5 +
     1.6 +import os
     1.7 +import time
     1.8 +import unittest
     1.9 +import proctest
    1.10 +from mozprocess import processhandler
    1.11 +
    1.12 +here = os.path.dirname(os.path.abspath(__file__))
    1.13 +
    1.14 +class ProcTestKill(proctest.ProcTest):
    1.15 +    """ Class to test various process tree killing scenatios """
    1.16 +
    1.17 +    # This test should ideally be a part of test_mozprocess_kill.py
    1.18 +    # It has been separated for the purpose of tempporarily disabling it.
    1.19 +    # See https://bugzilla.mozilla.org/show_bug.cgi?id=921632
    1.20 +    def test_process_kill_broad_wait(self):
    1.21 +        """Process is started, we use a broad process tree, we let it spawn
    1.22 +           for a bit, we kill it"""
    1.23 +
    1.24 +        p = processhandler.ProcessHandler([self.python, self.proclaunch, "process_normal_broad_python.ini"],
    1.25 +                                          cwd=here)
    1.26 +        p.run()
    1.27 +        # Let the tree spawn a bit, before attempting to kill
    1.28 +        time.sleep(3)
    1.29 +        p.kill()
    1.30 +
    1.31 +        detected, output = proctest.check_for_process(self.proclaunch)
    1.32 +        self.determine_status(detected,
    1.33 +                              output,
    1.34 +                              p.proc.returncode,
    1.35 +                              p.didTimeout,
    1.36 +                              expectedfail=('returncode',))
    1.37 +
    1.38 +if __name__ == '__main__':
    1.39 +    unittest.main()

mercurial