Commit 0ee42a68 authored by bratell@opera.com's avatar bratell@opera.com

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
parent 154c36c3
...@@ -86,7 +86,7 @@ class ScopedPoolTest(GitCommonTestBase): ...@@ -86,7 +86,7 @@ class ScopedPoolTest(GitCommonTestBase):
with self.assertRaises(KeyboardInterrupt): with self.assertRaises(KeyboardInterrupt):
with self.gc.ScopedPool(kind='threads') as pool: with self.gc.ScopedPool(kind='threads') as pool:
# Make sure this pool is interrupted in mid-swing # 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: if i > 32:
os.kill(os.getpid(), self.CTRL_C) os.kill(os.getpid(), self.CTRL_C)
result.append(i) result.append(i)
...@@ -103,7 +103,7 @@ class ScopedPoolTest(GitCommonTestBase): ...@@ -103,7 +103,7 @@ class ScopedPoolTest(GitCommonTestBase):
with self.assertRaises(KeyboardInterrupt): with self.assertRaises(KeyboardInterrupt):
with self.gc.ScopedPool() as pool: with self.gc.ScopedPool() as pool:
# Make sure this pool is interrupted in mid-swing # 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: if i > 32:
os.kill(os.getpid(), self.CTRL_C) os.kill(os.getpid(), self.CTRL_C)
result.append(i) result.append(i)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment