Skip to content

Commit

Permalink
Revert "Fix microsoft#941: Custom event with process information (mic…
Browse files Browse the repository at this point in the history
…rosoft#942)"

This reverts commit a2832ae.
  • Loading branch information
karthiknadig committed Oct 29, 2018
1 parent 9920fce commit 6045e83
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 108 deletions.
1 change: 0 additions & 1 deletion ptvsd/wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -1540,7 +1540,6 @@ def send_process_event(self, start_method):
'startMethod': start_method,
}
self.send_event('process', **evt)
self.send_event('ptvsd_process', **evt)

@async_handler
def on_threads(self, request, args):
Expand Down
8 changes: 3 additions & 5 deletions pytests/helpers/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -363,16 +363,14 @@ def start_debugging(self, freeze=True):
# The relative ordering of 'process' and 'configurationDone' is not deterministic.
# (implementation varies depending on whether it's launch or attach, but in any
# case, it is an implementation detail).
start = self.wait_for_next(Event('process') & Event('ptvsd_process') & Response(configurationDone_request))
start = self.wait_for_next(Event('process') & Response(configurationDone_request))

expected_process_body = {
self.expect_new(Event('process', {
'name': ANY.str,
'isLocalProcess': True,
'startMethod': 'launch' if self.method == 'launch' else 'attach',
'systemProcessId': self.pid if self.pid is not None else ANY.int,
}
self.expect_new(Event('process', expected_process_body))
self.expect_new(Event('ptvsd_process', expected_process_body))
}))

if not freeze:
self.proceed()
Expand Down
7 changes: 3 additions & 4 deletions tests/highlevel/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,10 +280,9 @@ def _handshake(self, command, threadnames=None, config=None, requests=None,

if process:
with self._fix.wait_for_event('process'):
with self._fix.wait_for_event('ptvsd_process'):
with self._fix.wait_for_event('thread'):
if self._pydevd:
self._pydevd.notify_main_thread()
with self._fix.wait_for_event('thread'):
if self._pydevd:
self._pydevd.notify_main_thread()

if reset:
self._fix.reset()
Expand Down
8 changes: 1 addition & 7 deletions tests/highlevel/test_lifecycle.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def attach(self, expected_os_id, attach_args):
req_attach = self.send_request('attach', attach_args)

# configuration
with self._fix.wait_for_events(['process', 'ptvsd_process']):
with self._fix.wait_for_events(['process']):
req_config = self.send_request('configurationDone')

# Normal ops would go here.
Expand Down Expand Up @@ -108,12 +108,6 @@ def attach(self, expected_os_id, attach_args):
isLocalProcess=True,
startMethod='attach',
)),
self.new_event('ptvsd_process', **dict(
name=sys.argv[0],
systemProcessId=os.getpid(),
isLocalProcess=True,
startMethod='attach',
)),
])
self.assert_received(self.debugger, [
self.debugger_msgs.new_request(CMD_VERSION,
Expand Down
16 changes: 0 additions & 16 deletions tests/highlevel/test_live_pydevd.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,14 +165,6 @@ def test_launch(self):
isLocalProcess=True,
startMethod='attach',
)),
self.new_event(
'ptvsd_process',
**dict(
name=sys.argv[0],
systemProcessId=os.getpid(),
isLocalProcess=True,
startMethod='attach',
)),
self.new_event('thread', reason='started', threadId=1),
#self.new_event('exited', exitCode=0),
#self.new_event('terminated'),
Expand Down Expand Up @@ -517,14 +509,6 @@ def test_basic(self):
isLocalProcess=True,
startMethod='attach',
)),
self.new_event(
'ptvsd_process',
**dict(
name=sys.argv[0],
systemProcessId=os.getpid(),
isLocalProcess=True,
startMethod='attach',
)),
self.new_event('thread', reason='started', threadId=1),
self.new_event(
'output',
Expand Down
18 changes: 0 additions & 18 deletions tests/highlevel/test_messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -2403,12 +2403,6 @@ def test_launched(self):
isLocalProcess=True,
startMethod='launch',
)),
self.new_event('ptvsd_process', **dict(
name=sys.argv[0],
systemProcessId=os.getpid(),
isLocalProcess=True,
startMethod='launch',
)),
self.expected_event(
reason='started',
threadId=tid,
Expand All @@ -2430,12 +2424,6 @@ def test_attached(self):
isLocalProcess=True,
startMethod='attach',
)),
self.new_event('ptvsd_process', **dict(
name=sys.argv[0],
systemProcessId=os.getpid(),
isLocalProcess=True,
startMethod='attach',
)),
self.expected_event(
reason='started',
threadId=tid,
Expand All @@ -2457,12 +2445,6 @@ def test_process_one_off(self):
isLocalProcess=True,
startMethod='launch',
)),
self.new_event('ptvsd_process', **dict(
name=sys.argv[0],
systemProcessId=os.getpid(),
isLocalProcess=True,
startMethod='launch',
)),
self.expected_event(
reason='started',
threadId=tid1,
Expand Down
60 changes: 3 additions & 57 deletions tests/system_tests/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def test_launch_ptvsd_client(self):
# Skipping the "thread exited" and "terminated" messages which
# may appear randomly in the received list.
received = list(_strip_newline_output_events(session.received))
self.assert_received(received[:8], [
self.assert_received(received[:7], [
self.new_version_event(session.received),
self.new_response(req_initialize.req, **INITIALIZE_RESPONSE),
self.new_event('initialized'),
Expand All @@ -141,12 +141,6 @@ def test_launch_ptvsd_client(self):
'startMethod': 'launch',
'name': filename,
}),
self.new_event('ptvsd_process', **{
'isLocalProcess': True,
'systemProcessId': adapter.pid,
'startMethod': 'launch',
'name': filename,
}),
self.new_event('thread', reason='started', threadId=1),
])

Expand All @@ -168,7 +162,7 @@ def test_launch_ptvsd_server(self):
adapter.wait()

received = list(_strip_newline_output_events(session.received))
self.assert_received(received[:8], [
self.assert_received(received[:7], [
self.new_version_event(session.received),
self.new_response(req_initialize.req, **INITIALIZE_RESPONSE),
self.new_event('initialized'),
Expand All @@ -180,12 +174,6 @@ def test_launch_ptvsd_server(self):
'startMethod': 'launch',
'name': filename,
}),
self.new_event('ptvsd_process', **{
'isLocalProcess': True,
'systemProcessId': adapter.pid,
'startMethod': 'launch',
'name': filename,
}),
self.new_event('thread', reason='started', threadId=1),
#self.new_event('thread', reason='exited', threadId=1),
#self.new_event('exited', exitCode=0),
Expand All @@ -209,7 +197,7 @@ def test_attach_started_separately(self):
adapter.wait()

received = list(_strip_newline_output_events(session.received))
self.assert_received(received[:8], [
self.assert_received(received[:7], [
self.new_version_event(session.received),
self.new_response(req_initialize.req, **INITIALIZE_RESPONSE),
self.new_event('initialized'),
Expand All @@ -221,12 +209,6 @@ def test_attach_started_separately(self):
'startMethod': 'attach',
'name': filename,
}),
self.new_event('ptvsd_process', **{
'isLocalProcess': True,
'systemProcessId': adapter.pid,
'startMethod': 'attach',
'name': filename,
}),
self.new_event('thread', reason='started', threadId=1),
#self.new_event('thread', reason='exited', threadId=1),
#self.new_event('exited', exitCode=0),
Expand Down Expand Up @@ -283,12 +265,6 @@ def test_attach_embedded(self):
'startMethod': 'attach',
'name': filename,
}),
self.new_event('ptvsd_process', **{
'isLocalProcess': True,
'systemProcessId': adapter.pid,
'startMethod': 'attach',
'name': filename,
}),
self.new_event('output', output='success!', category='stdout'),
self.new_event('exited', exitCode=0),
self.new_event('terminated'),
Expand Down Expand Up @@ -338,12 +314,6 @@ def test_reattach(self):
'startMethod': 'attach',
'name': filename,
}),
self.new_event('ptvsd_process', **{
'isLocalProcess': True,
'systemProcessId': adapter.pid,
'startMethod': 'attach',
'name': filename,
}),
self.new_event('thread', reason='started', threadId=1),
self.new_response(req_disconnect.req),
])
Expand All @@ -362,12 +332,6 @@ def test_reattach(self):
'startMethod': 'attach',
'name': filename,
}),
self.new_event('ptvsd_process', **{
'isLocalProcess': True,
'systemProcessId': adapter.pid,
'startMethod': 'attach',
'name': filename,
}),
self.new_event('exited', exitCode=0),
self.new_event('terminated'),
])
Expand Down Expand Up @@ -487,12 +451,6 @@ def test_detach_clear_and_resume(self):
'startMethod': 'attach',
'name': filename,
}),
self.new_event('ptvsd_process', **{
'isLocalProcess': True,
'systemProcessId': adapter.pid,
'startMethod': 'attach',
'name': filename,
}),
self.new_response(req_bps.req, **{
'breakpoints': [{
'id': 1,
Expand Down Expand Up @@ -548,12 +506,6 @@ def test_detach_clear_and_resume(self):
'startMethod': 'attach',
'name': filename,
}),
self.new_event('ptvsd_process', **{
'isLocalProcess': True,
'systemProcessId': adapter.pid,
'startMethod': 'attach',
'name': filename,
}),
#self.new_event(
# 'thread',
# threadId=tid2,
Expand Down Expand Up @@ -769,12 +721,6 @@ def test_attach_breakpoints(self):
'startMethod': 'attach',
'name': filename,
}),
self.new_event('ptvsd_process', **{
'isLocalProcess': True,
'systemProcessId': adapter.pid,
'startMethod': 'attach',
'name': filename,
}),
self.new_event(
'stopped',
threadId=tid,
Expand Down

0 comments on commit 6045e83

Please sign in to comment.