From 0ee42a68c1ae2e3b3ef78b2a55683ab8259817bc Mon Sep 17 00:00:00 2001 From: "bratell@opera.com" Date: Thu, 12 Dec 2013 14:16:49 +0000 Subject: [PATCH] Avoid windows presubmit hang in gclient tests. If os.kill(os.getpid(), signal.CTRL_C_EVENT) doesn't do what the test author hopes it will do, the test will hang until it has calculated a million out-of-thread/process results. That is approximately an infinite hang. BUG= Review URL: https://codereview.chromium.org/110883004 git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@240319 0039d316-1c4b-4281-b951-d872f2087c98 --- tests/git_common_test.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/git_common_test.py b/tests/git_common_test.py index 8b961340ec..9b8a495b50 100755 --- a/tests/git_common_test.py +++ b/tests/git_common_test.py @@ -86,7 +86,7 @@ class ScopedPoolTest(GitCommonTestBase): with self.assertRaises(KeyboardInterrupt): with self.gc.ScopedPool(kind='threads') as pool: # Make sure this pool is interrupted in mid-swing - for i in pool.imap(slow_square, xrange(1000000)): + for i in pool.imap(slow_square, xrange(20)): if i > 32: os.kill(os.getpid(), self.CTRL_C) result.append(i) @@ -103,7 +103,7 @@ class ScopedPoolTest(GitCommonTestBase): with self.assertRaises(KeyboardInterrupt): with self.gc.ScopedPool() as pool: # Make sure this pool is interrupted in mid-swing - for i in pool.imap(slow_square, xrange(1000000)): + for i in pool.imap(slow_square, xrange(20)): if i > 32: os.kill(os.getpid(), self.CTRL_C) result.append(i)