Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1597)

Unified Diff: recipes/engine_tests/bad_subprocess.py

Issue 1959563002: Use subprocess42 in recipe_engine to avoid threading madness. (Closed) Base URL: https://chromium.googlesource.com/external/github.com/luci/recipes-py@master
Patch Set: *sigh* presubmit Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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')
+
« no previous file with comments | « recipe_engine/unittests/step_runner_test.py ('k') | recipes/engine_tests/bad_subprocess.expected/basic.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698