MCPcopy Create free account
hub / github.com/microsoft/debugpy / wait_for_exit

Method wait_for_exit

tests/debug/session.py:975–991  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

973 self.timeline.wait_until_realized(timeline.Mark("disconnect"), freeze=True)
974
975 def wait_for_exit(self):
976 if self.debuggee is not None:
977 log.info("Waiting for {0} to exit ...", self.debuggee_id)
978 try:
979 self.debuggee.wait()
980 except Exception:
981 pass
982 finally:
983 watchdog.unregister_spawn(self.debuggee.pid, self.debuggee_id)
984
985 self.wait_for_terminated()
986
987 # FIXME: "exited" event is not properly reported in attach scenarios at the
988 # moment, so the exit code is only checked if it's present.
989 if self.debuggee is not None and self.exit_code is not None:
990 assert self.debuggee.returncode == self.exit_code
991 return self.exit_code
992
993 def wait_for_terminated(self):
994 self.timeline.wait_until_realized(timeline.Event("terminated"))

Callers 4

__exit__Method · 0.95
test_autokillFunction · 0.80
test_breakaway_jobFunction · 0.80
test_reattachFunction · 0.80

Calls 3

wait_for_terminatedMethod · 0.95
infoMethod · 0.80
waitMethod · 0.45

Tested by 3

test_autokillFunction · 0.64
test_breakaway_jobFunction · 0.64
test_reattachFunction · 0.64