MCPcopy Create free account
hub / github.com/saltstack/salt / test_counter

Method test_counter

tests/unit/utils/test_process.py:144–153  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

142
143 @incr
144 def test_counter(self):
145 counter = multiprocessing.Value("i", 0)
146 process_manager = salt.utils.process.ProcessManager()
147 self.addCleanup(process_manager.terminate)
148 process_manager.add_process(self.incr_counter, args=(counter, 2))
149 time.sleep(1)
150 process_manager.check_children()
151 time.sleep(1)
152 # we should have had 2 processes go at it
153 assert counter.value == 4
154
155
156class TestThreadPool(TestCase):

Callers

nothing calls this directly

Calls 3

add_processMethod · 0.95
check_childrenMethod · 0.95
sleepMethod · 0.45

Tested by

no test coverage detected