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
experimental/szager/collated-output
bratell@opera.com 12 years ago
parent 154c36c357
commit 0ee42a68c1

@ -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)

Loading…
Cancel
Save