diff --git a/azure-pipelines/pipelines.yaml b/azure-pipelines/pipelines.yaml index 3d437e6a..0c8f0dff 100644 --- a/azure-pipelines/pipelines.yaml +++ b/azure-pipelines/pipelines.yaml @@ -28,7 +28,7 @@ jobs: pool: { vmImage: "ubuntu-latest" } variables: - python.version: "3.8" + python.version: "3.9" steps: @@ -57,8 +57,6 @@ jobs: strategy: matrix: - py38: - python.version: "3.8" py39: python.version: "3.9" py310: @@ -87,8 +85,6 @@ jobs: strategy: matrix: - py38: - python.version: "3.8" py39: python.version: "3.9" py310: @@ -117,8 +113,6 @@ jobs: strategy: matrix: - py38: - python.version: "3.8" py39: python.version: "3.9" py39_32: diff --git a/azure-pipelines/templates/run_tests.yml b/azure-pipelines/templates/run_tests.yml index a853e08e..6bb65cf4 100644 --- a/azure-pipelines/templates/run_tests.yml +++ b/azure-pipelines/templates/run_tests.yml @@ -10,16 +10,19 @@ steps: echo 'tox environment: $toxEnv' python -m tox -e $toxEnv -- --junitxml=$(Build.ArtifactStagingDirectory)/tests.xml --debugpy-log-dir=$(Build.ArtifactStagingDirectory)/logs tests displayName: "Run tests using tox" + env: + DEBUGPY_PROCESS_SPAWN_TIMEOUT: 60 + DEBUGPY_LAUNCH_TIMEOUT: 60 - - task: "PublishBuildArtifacts@1" - condition: "failed()" + - task: PublishBuildArtifacts@1 + condition: failed() inputs: artifactName: "Test logs" pathToPublish: "$(Build.ArtifactStagingDirectory)/logs" displayName: "Publish test logs" - - task: "PublishTestResults@2" - condition: "always()" + - task: PublishTestResults@2 + condition: always() inputs: testRunTitle: "$(Agent.JobName)" testResultsFiles: "tests.xml" diff --git a/src/debugpy/adapter/components.py b/src/debugpy/adapter/components.py index cc88d141..1a653407 100644 --- a/src/debugpy/adapter/components.py +++ b/src/debugpy/adapter/components.py @@ -7,7 +7,7 @@ import functools from debugpy.common import json, log, messaging, util -ACCEPT_CONNECTIONS_TIMEOUT = 10 +ACCEPT_CONNECTIONS_TIMEOUT = 60 class ComponentNotAvailable(Exception): diff --git a/src/debugpy/server/cli.py b/src/debugpy/server/cli.py index 0fc5e255..a9c442f9 100644 --- a/src/debugpy/server/cli.py +++ b/src/debugpy/server/cli.py @@ -8,6 +8,9 @@ import re import sys from importlib.util import find_spec from typing import Any +from typing import Union +from typing import Tuple +from typing import Dict # debugpy.__main__ should have preloaded pydevd properly before importing this module. # Otherwise, some stdlib modules above might have had imported threading before pydevd @@ -43,14 +46,14 @@ Usage: debugpy --listen | --connect class Options(object): mode = None - address: "tuple[str, int] | None" = None + address: Union[Tuple[str, int], None] = None log_to = None log_to_stderr = False - target: str | None = None - target_kind: str | None = None + target: Union[str, None] = None + target_kind: Union[str, None] = None wait_for_client = False adapter_access_token = None - config: "dict[str, Any]" = {} + config: Dict[str, Any] = {} options = Options() diff --git a/tests/debugpy/test_exception.py b/tests/debugpy/test_exception.py index 31f315e7..b45a66c7 100644 --- a/tests/debugpy/test_exception.py +++ b/tests/debugpy/test_exception.py @@ -150,6 +150,7 @@ def test_vsc_exception_options_raise_without_except( sys.platform == "darwin", reason="https://github.com/microsoft/ptvsd/issues/1988", ) +@pytest.mark.flaky(retries=2, delay=1) @pytest.mark.parametrize("target", targets.all_named) @pytest.mark.parametrize("run", runners.all) @pytest.mark.parametrize("raised", ["raised", ""]) diff --git a/tests/debugpy/test_numpy.py b/tests/debugpy/test_numpy.py index aa70a19e..2a9ebd90 100644 --- a/tests/debugpy/test_numpy.py +++ b/tests/debugpy/test_numpy.py @@ -51,7 +51,7 @@ def test_ndarray(pyfile, target, run): { "type": "int32", "name": "0", - "value": "123", + "value": some.str.containing("123"), "variablesReference": some.int, } ), @@ -59,7 +59,7 @@ def test_ndarray(pyfile, target, run): { "type": "int32", "name": "1", - "value": "456", + "value": some.str.containing("456"), "variablesReference": some.int, } ), diff --git a/tests/requirements.txt b/tests/requirements.txt index 12784fe3..fa0a4ea5 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -4,6 +4,7 @@ pytest pytest-xdist pytest-cov pytest-timeout +pytest-retry ## Used by test helpers: