MCPcopy Index your code
hub / github.com/saltstack/salt / test_kill

Method test_kill

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

Source from the content-addressed store, hash-verified

113
114 @spin
115 def test_kill(self):
116 process_manager = salt.utils.process.ProcessManager()
117 self.addCleanup(process_manager.terminate)
118 process_manager.add_process(self.spin_kill)
119 initial_pid = next(iter(process_manager._process_map.keys()))
120 # kill the child
121 if salt.utils.platform.is_windows():
122 os.kill(initial_pid, signal.SIGTERM)
123 else:
124 os.kill(initial_pid, signal.SIGKILL)
125 # give the OS time to give the signal...
126 time.sleep(0.1)
127 process_manager.check_children()
128 assert initial_pid != next(iter(process_manager._process_map.keys()))
129
130 @die
131 def test_restarting(self):

Callers

nothing calls this directly

Calls 5

add_processMethod · 0.95
check_childrenMethod · 0.95
killMethod · 0.80
keysMethod · 0.45
sleepMethod · 0.45

Tested by

no test coverage detected