| Index: recipe_engine/unittests/run_test.py
|
| diff --git a/recipe_engine/unittests/run_test.py b/recipe_engine/unittests/run_test.py
|
| index da6b81c15c163f500fed04959cb2a9e1417f6a4e..06ead3fe0c2cbfbb9b70c33fbad7ba82771cbd27 100755
|
| --- a/recipe_engine/unittests/run_test.py
|
| +++ b/recipe_engine/unittests/run_test.py
|
| @@ -9,6 +9,7 @@ import re
|
| import subprocess
|
| import sys
|
| import unittest
|
| +import time
|
|
|
| BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(
|
| os.path.abspath(__file__))))
|
| @@ -143,7 +144,7 @@ class RunTest(unittest.TestCase):
|
| self._run_cmd('engine_tests/subannotations'),
|
| stdout=subprocess.PIPE,
|
| stderr=subprocess.PIPE)
|
| - stdout, stderr = proc.communicate()
|
| + stdout, _ = proc.communicate()
|
| self.assertRegexpMatches(stdout, r'(?m)^!@@@BUILD_STEP@steppy@@@$')
|
| self.assertRegexpMatches(stdout, r'(?m)^@@@BUILD_STEP@pippy@@@$')
|
| # Before 'Subannotate me' we expect an extra STEP_CURSOR to reset the
|
| @@ -151,6 +152,16 @@ class RunTest(unittest.TestCase):
|
| self.assertRegexpMatches(stdout,
|
| r'(?m)^@@@STEP_CURSOR@Subannotate me@@@\n@@@STEP_CLOSED@@@$')
|
|
|
| + def test_bad_subprocess(self):
|
| + now = time.time()
|
| + self._test_recipe('engine_tests/bad_subprocess')
|
| + after = time.time()
|
| +
|
| + # Test has an internal 10s timeout for the bad daemon step, but the daemon's
|
| + # parent process quits immediately. If this takes longer than 5 seconds to
|
| + # run, we consider it failed.
|
| + self.assertLess(after - now, 5)
|
| +
|
|
|
| if __name__ == '__main__':
|
| unittest.TestCase.maxDiff = None
|
|
|