Skip to content
This repository has been archived by the owner on Aug 2, 2023. It is now read-only.

Commit

Permalink
Send a CMD_RUN response.
Browse files Browse the repository at this point in the history
  • Loading branch information
ericsnowcurrently committed Feb 13, 2018
1 parent b1e6522 commit 09e05b1
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 3 deletions.
2 changes: 2 additions & 0 deletions tests/ptvsd/highlevel/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

from _pydevd_bundle.pydevd_comm import (
CMD_VERSION,
CMD_RUN,
)

from tests.helpers.pydevd import FakePyDevd
Expand Down Expand Up @@ -91,6 +92,7 @@ def _handshake(self, vsc, pydevd, command,
}
with vsc.wait_for_response(req):
vsc.send_request(req)
pydevd.add_pending_response(CMD_RUN, '')

This comment has been minimized.

Copy link
@DonJayamanne

DonJayamanne Feb 17, 2018

Contributor

@ericsnowcurrently
Not sure whether this matters, but we recently learnt that CMD_RUN does not send back a response in pydevd

This comment has been minimized.

Copy link
@ericsnowcurrently

ericsnowcurrently Feb 20, 2018

Author Member

Yeah, I noticed that and noticed ptvsd was expecting a response. So I went with what ptvsd was doing. I'll fix it.

This comment has been minimized.

Copy link
@ericsnowcurrently

ericsnowcurrently Feb 21, 2018

Author Member

fixed :)

req = {
'type': 'request',
'seq': self.next_vsc_seq(),
Expand Down
33 changes: 30 additions & 3 deletions tests/ptvsd/highlevel/test_basic.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import os
import sys

from _pydevd_bundle.pydevd_comm import (
CMD_VERSION,
CMD_RUN,
Expand All @@ -6,7 +9,7 @@
from . import OS_ID, HighlevelTestCase


class LivecycleTests(HighlevelTestCase):
class LifecycleTests(HighlevelTestCase):
"""
See https://code.visualstudio.com/docs/extensionAPI/api-debugging#_the-vs-code-debug-protocol-in-a-nutshell
""" # noqa
Expand Down Expand Up @@ -40,6 +43,7 @@ def test_attach(self):
vsc.send_request(req_attach)

# configuration
pydevd.add_pending_response(CMD_RUN, '')
req_config = {
'type': 'request',
'seq': self.next_vsc_seq(),
Expand Down Expand Up @@ -114,8 +118,19 @@ def test_attach(self):
'body': {},
},
{
'type': 'response',
'type': 'event',
'seq': 4,
'event': 'process',
'body': {
'name': sys.argv[0],
'systemProcessId': os.getpid(),
'isLocalProcess': True,
'startMethod': 'attach',
},
},
{
'type': 'response',
'seq': 5,
'request_seq': req_disconnect['seq'],
'command': 'disconnect',
'success': True,
Expand Down Expand Up @@ -162,6 +177,7 @@ def test_launch(self):
vsc.send_request(req_launch)

# configuration
pydevd.add_pending_response(CMD_RUN, '')
req_config = {
'type': 'request',
'seq': self.next_vsc_seq(),
Expand Down Expand Up @@ -236,8 +252,19 @@ def test_launch(self):
'body': {},
},
{
'type': 'response',
'type': 'event',
'seq': 4,
'event': 'process',
'body': {
'name': sys.argv[0],
'systemProcessId': os.getpid(),
'isLocalProcess': True,
'startMethod': 'launch',
},
},
{
'type': 'response',
'seq': 5,
'request_seq': req_disconnect['seq'],
'command': 'disconnect',
'success': True,
Expand Down

0 comments on commit 09e05b1

Please sign in to comment.