| Index: recipes/engine_tests/bad_subprocess.py
|
| diff --git a/recipes/engine_tests/bad_subprocess.py b/recipes/engine_tests/bad_subprocess.py
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..8023943e5a9a6701ae9104aa640e90a7ef96aaab
|
| --- /dev/null
|
| +++ b/recipes/engine_tests/bad_subprocess.py
|
| @@ -0,0 +1,37 @@
|
| +# Copyright 2016 The Chromium Authors. All rights reserved.
|
| +# Use of this source code is governed by a BSD-style license that can be
|
| +# found in the LICENSE file.
|
| +
|
| +"""Tests that daemons that hang on to STDOUT can't cause the engine to hang."""
|
| +
|
| +DEPS = [
|
| + 'python',
|
| +]
|
| +
|
| +def RunSteps(api):
|
| + api.python.inline("bad deamon", """
|
| + import os
|
| + import time
|
| + import sys
|
| +
|
| + print "parent"
|
| + pid = os.fork()
|
| + if pid > 0:
|
| + "parent leaves"
|
| + sys.exit(0)
|
| +
|
| + print "child"
|
| + pid = os.fork()
|
| + if pid > 0:
|
| + "child leaves"
|
| + sys.exit(0)
|
| +
|
| + print "daemon sleepin'"
|
| + time.sleep(30)
|
| +
|
| + print "ROAAARRRR!!!"
|
| + """)
|
| +
|
| +def GenTests(api):
|
| + yield api.test('basic')
|
| +
|
|
|