MCPcopy Index your code
hub / github.com/nodejs/node / testAdd

Method testAdd

deps/v8/tools/testrunner/local/pool_test.py:54–66  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

52 self.assertEqual(expect, results)
53
54 def testAdd(self):
55 results = set()
56 pool = DefaultExecutionPool()
57 pool.init(3)
58 for result in pool.imap_unordered(Run, [[x] for x in range(0, 10)]):
59 if result.heartbeat:
60 # Any result can be a heartbeat due to timings.
61 continue
62 results.add(result.value)
63 if result.value < 30:
64 pool.add([result.value + 20])
65 self.assertEqual(
66 set(range(0, 10)) | set(range(20, 30)) | set(range(40, 50)), results)
67
68
69class QueueTest(unittest.TestCase):

Callers

nothing calls this directly

Calls 7

initMethod · 0.95
imap_unorderedMethod · 0.95
addMethod · 0.95
addMethod · 0.65
setFunction · 0.50
rangeFunction · 0.50

Tested by

no test coverage detected