microsoft / vscode-python

Python extension for Visual Studio Code
https://aka.ms/pvsc-marketplace
MIT License
4.28k stars 1.17k forks source link

Decoding unicode string fails while running unit tests. #23466

Open tongfa opened 3 months ago

tongfa commented 3 months ago

Type: Bug

Behaviour

Steps to reproduce:

  1. run VSCode targeting a remote host over ssh running pytest
  2. download this minimal git repo which reproduces the issue
  3. run a collection of 1000 unit tests at once by clicking in the "Testing" view of the Activity Bar

you should see this error.

Traceback (most recent call last):
  File "/home/ubuntu/.vscode-server/extensions/ms-python.python-2024.6.0/python_files/vscode_pytest/run_pytest_script.py", line 39, in <module>
    data = sock.read(3000)
  File "/home/ubuntu/.vscode-server/extensions/ms-python.python-2024.6.0/python_files/testing_tools/socket_manager.py", line 75, in read
    data = part.decode("utf-8")
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe1 in position 2999: unexpected end of data
Finished running tests!

I believe the underlying issue is unicode characters in test function names, i.e. the circles in:

def test_ᐤᐤᐤᐤᐤᐤᐤᐤᐤᐤᐤᐤᐤᐤᐤᐤᐤᐤᐤᐤᐤᐤ952():

When running a large set of unit tests each test name is provided to the pytest invocation on the client machine as command line args. If there are enough tests to cross a 1024 byte boundary (or maybe its 3000), then there is a chance that PipeManager in socket_manager.py will do a read that does not terminate on a unicode code point boundary.

For example, say the character ᐤ is encoded as two bytes, A and B, then it's possible by reading 1024 bytes that the final character of the bunch is only A, and that B will be available in a subsequent read. Decoding a string under this condition will result in the above error:

I was able to confirm the above theory by patching by socket_manager as follows:

diff --git a/python_files/testing_tools/socket_manager.py b/python_files/testing_tools/socket_manager.py
index 31b78b254..b497c8c61 100644
--- a/python_files/testing_tools/socket_manager.py
+++ b/python_files/testing_tools/socket_manager.py
@@ -69,10 +69,14 @@ class PipeManager:
             return self._reader.read(bufsize)
         else:
             # receive bytes and convert to string
+            part: bytes = self._socket.recv(bufsize)
             while True:
-                part: bytes = self._socket.recv(bufsize)
-                data: str = part.decode("utf-8")
-                return data
+                try:
+                    data = part.decode("utf-8")
+                    return data
+                except UnicodeDecodeError:
+                    # try reading one more byte
+                    part += self._socket.recv(1)

 class SocketManager(object):

If I were to PR this I would like some feedback on this approach. It does rely on exception handling which isn't ideal. And reading one byte at a time seems inefficient. And could a genuine utf encoding error put this into an infinite loop? Are any of those issues severe enough to warrant improvements? (I think the last one is for sure.)

Diagnostic data

Output for Python in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python)

``` 2024-05-22 14:55:26.221 [info] Experiment 'pythonaa' is active 2024-05-22 14:55:26.221 [info] Experiment 'pythonCreateEnvOnPipInstallcf' is active 2024-05-22 14:55:26.221 [info] Experiment 'pythonRecommendTensorboardExt' is active 2024-05-22 14:55:26.221 [info] Experiment 'pythonTerminalEnvVarActivation' is active 2024-05-22 14:55:26.221 [info] Experiment 'pythonTestAdapter' is active 2024-05-22 14:55:26.221 [info] Default formatter is set to null for workspace /home/ubuntu/massive-tests 2024-05-22 14:55:26.221 [info] Python interpreter path: ./venv/bin/python 2024-05-22 14:55:26.256 [info] > pyenv which python 2024-05-22 14:55:26.256 [info] cwd: . 2024-05-22 14:55:26.311 [info] > . ./venv/bin/activate && echo 'e8b39361-0157-4923-80e1-22d70d46dee6' && python ~/.vscode-server/extensions/ms-python.python-2024.6.0/python_files/printEnvVariables.py 2024-05-22 14:55:26.311 [info] shell: bash 2024-05-22 14:55:26.333 [info] > /bin/python3 ~/.vscode-server/extensions/ms-python.python-2024.6.0/python_files/printEnvVariables.py 2024-05-22 14:55:26.333 [info] shell: bash 2024-05-22 14:55:26.350 [info] Setting environment variable VIRTUAL_ENV in collection to /home/ubuntu/massive-tests/venv {"applyAtShellIntegration":true,"applyAtProcessCreation":true} 2024-05-22 14:55:26.350 [info] Prepending environment variable PS1 in collection with (venv) {"applyAtShellIntegration":true,"applyAtProcessCreation":false} 2024-05-22 14:55:26.350 [info] Prepending environment variable PATH in collection with /home/ubuntu/.vscode-server/extensions/ms-python.python-2024.6.0/python_files/deactivate/bash:/home/ubuntu/massive-tests/venv/bin: {"applyAtShellIntegration":true,"applyAtProcessCreation":true} 2024-05-22 14:55:26.351 [info] Send text to terminal: /bin/python3 /home/ubuntu/.vscode-server/extensions/ms-python.python-2024.6.0/python_files/printEnvVariablesToFile.py /home/ubuntu/.vscode-server/extensions/ms-python.python-2024.6.0/python_files/deactivate/bash/envVars.txt 2024-05-22 14:55:27.098 [info] Starting Pylance language server. 2024-05-22 14:56:09.497 [info] Discover tests for workspace name: massive-tests - uri: /home/ubuntu/massive-tests 2024-05-22 14:56:09.497 [info] Running discovery for pytest using the new test adapter. 2024-05-22 14:56:09.498 [info] All environment variables set for pytest discovery: {"USER":"ubuntu","SSH_CLIENT":"172.19.160.1 54807 22","XDG_SESSION_TYPE":"tty","SHLVL":"0","MOTD_SHOWN":"pam","HOME":"/home/ubuntu","SSL_CERT_FILE":"/usr/lib/ssl/certs/ca-certificates.crt","DBUS_SESSION_BUS_ADDRESS":"unix:path=/run/user/1001/bus","LOGNAME":"ubuntu","_":"/home/ubuntu/.vscode-server/cli/servers/Stable-dc96b837cf6bb4af9cd736aa3af08cf8279f7685/server/node","XDG_SESSION_CLASS":"user","VSCODE_CLI_REQUIRE_TOKEN":"30c43a77-5a4a-4596-a1c8-427121d317a3","XDG_SESSION_ID":"3","VSCODE_AGENT_FOLDER":"/home/ubuntu/.vscode-server","XDG_RUNTIME_DIR":"/run/user/1001","SSL_CERT_DIR":"/usr/lib/ssl/certs","LANG":"C.UTF-8","SHELL":"/bin/bash","PWD":"/home/ubuntu","SSH_CONNECTION":"172.19.160.1 54807 172.19.164.74 22","VSCODE_HANDLES_SIGPIPE":"true","LS_COLORS":"","RALLY_URL":"https://staging.sdvi.com","LESSCLOSE":"/usr/bin/lesspipe %s %s","LESSOPEN":"| /usr/bin/lesspipe %s","XDG_DATA_DIRS":"/usr/local/share:/usr/share:/var/lib/snapd/desktop","STAMP_PERSISTENCE_LOCATION":"/home/ubuntu/.config/sdvi-kick","RALLY_API_TOKEN":"HfzuhYgi6mhcVt+uZE1NovstPolsUt7JuskyvIHDPSYTKCXEghlo2q4m4SwIauu+","VSCODE_AMD_ENTRYPOINT":"vs/workbench/api/node/extensionHostProcess","VSCODE_HANDLES_UNCAUGHT_ERRORS":"true","VSCODE_NLS_CONFIG":"{\"locale\":\"en\",\"osLocale\":\"en\",\"availableLanguages\":{}}","BROWSER":"/home/ubuntu/.vscode-server/cli/servers/Stable-dc96b837cf6bb4af9cd736aa3af08cf8279f7685/server/bin/helpers/browser.sh","VSCODE_CWD":"/home/ubuntu","ELECTRON_RUN_AS_NODE":"1","VSCODE_IPC_HOOK_CLI":"/run/user/1001/vscode-ipc-ec5a8dcc-a31b-43f0-b262-73a2769eef2b.sock","PATH":"/home/ubuntu/.vscode-server/cli/servers/Stable-dc96b837cf6bb4af9cd736aa3af08cf8279f7685/server/bin/remote-cli:/home/ubuntu/.local/bin:/home/ubuntu/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin","PYTHONPATH":"/home/ubuntu/.vscode-server/extensions/ms-python.python-2024.6.0/python_files","TEST_RUN_PIPE":"/run/user/1001/python-test-discovery-f24fcc81ccfdc66f0d0e.sock"} 2024-05-22 14:56:09.511 [info] > . ./venv/bin/activate && echo 'e8b39361-0157-4923-80e1-22d70d46dee6' && python ~/.vscode-server/extensions/ms-python.python-2024.6.0/python_files/printEnvVariables.py 2024-05-22 14:56:09.511 [info] shell: bash 2024-05-22 14:56:09.529 [info] > ./venv/bin/python -m pytest -p vscode_pytest --collect-only . 2024-05-22 14:56:09.529 [info] cwd: . 2024-05-22 14:56:09.646 [info] ============================= test session starts ============================== platform linux -- Python 3.8.10, pytest-8.2.1, pluggy-1.5.0 2024-05-22 14:56:09.646 [info] rootdir: /home/ubuntu/massive-tests configfile: pytest.ini 2024-05-22 14:56:09.806 [info] collected 1000 items

2024-05-22 14:56:09.806 [info] MASSIVE SNIP of similar lines to reduce character count 2024-05-22 14:56:09.807 [info] MASSIVE SNIP of similar lines to reduce character count 2024-05-22 14:56:09.807 [info] MASSIVE SNIP of similar lines to reduce character count 2024-05-22 14:56:09.807 [info] MASSIVE SNIP of similar lines to reduce character count 2024-05-22 14:56:09.807 [info] 2024-05-22 14:56:09.807 [info] 2024-05-22 14:56:09.807 [info] 2024-05-22 14:56:09.807 [info] 2024-05-22 14:56:09.807 [info] 2024-05-22 14:56:09.807 [info] 2024-05-22 14:56:09.807 [info] 2024-05-22 14:56:09.807 [info] 2024-05-22 14:56:09.807 [info] 2024-05-22 14:56:09.807 [info] 2024-05-22 14:56:09.808 [info] 2024-05-22 14:56:09.808 [info] 2024-05-22 14:56:09.808 [info] 2024-05-22 14:56:09.808 [info] 2024-05-22 14:56:09.808 [info] 2024-05-22 14:56:09.808 [info] 2024-05-22 14:56:09.808 [info] 2024-05-22 14:56:09.808 [info] 2024-05-22 14:56:09.808 [info] 2024-05-22 14:56:09.808 [info] 2024-05-22 14:56:09.808 [info] 2024-05-22 14:56:09.808 [info] 2024-05-22 14:56:09.808 [info] 2024-05-22 14:56:09.808 [info] 2024-05-22 14:56:09.808 [info] 2024-05-22 14:56:09.808 [info] 2024-05-22 14:56:09.808 [info] 2024-05-22 14:56:09.808 [info] 2024-05-22 14:56:09.808 [info] 2024-05-22 14:56:09.808 [info] 2024-05-22 14:56:09.808 [info] 2024-05-22 14:56:09.808 [info] 2024-05-22 14:56:09.808 [info] 2024-05-22 14:56:09.808 [info] 2024-05-22 14:56:09.808 [info] 2024-05-22 14:56:09.808 [info] 2024-05-22 14:56:09.808 [info] 2024-05-22 14:56:09.808 [info] 2024-05-22 14:56:09.808 [info] 2024-05-22 14:56:09.809 [info] 2024-05-22 14:56:09.809 [info] 2024-05-22 14:56:09.809 [info] 2024-05-22 14:56:09.809 [info] 2024-05-22 14:56:09.809 [info] 2024-05-22 14:56:09.809 [info] 2024-05-22 14:56:09.809 [info] 2024-05-22 14:56:09.809 [info] 2024-05-22 14:56:09.809 [info] 2024-05-22 14:56:09.809 [info] 2024-05-22 14:56:09.809 [info] 2024-05-22 14:56:09.809 [info] 2024-05-22 14:56:09.809 [info] 2024-05-22 14:56:09.809 [info] 2024-05-22 14:56:09.809 [info] 2024-05-22 14:56:09.809 [info] 2024-05-22 14:56:09.809 [info] 2024-05-22 14:56:09.809 [info] 2024-05-22 14:56:09.809 [info] 2024-05-22 14:56:09.809 [info] 2024-05-22 14:56:09.809 [info] 2024-05-22 14:56:09.809 [info] 2024-05-22 14:56:09.809 [info] 2024-05-22 14:56:09.809 [info] 2024-05-22 14:56:09.809 [info] 2024-05-22 14:56:09.809 [info] 2024-05-22 14:56:09.809 [info] 2024-05-22 14:56:09.809 [info] 2024-05-22 14:56:09.809 [info] 2024-05-22 14:56:09.809 [info] 2024-05-22 14:56:09.809 [info] 2024-05-22 14:56:09.809 [info] 2024-05-22 14:56:09.809 [info] 2024-05-22 14:56:09.809 [info] 2024-05-22 14:56:09.809 [info] 2024-05-22 14:56:09.809 [info] 2024-05-22 14:56:09.809 [info] 2024-05-22 14:56:09.809 [info] 2024-05-22 14:56:09.809 [info] 2024-05-22 14:56:09.809 [info] 2024-05-22 14:56:09.809 [info] 2024-05-22 14:56:09.809 [info] 2024-05-22 14:56:09.809 [info] 2024-05-22 14:56:09.809 [info] 2024-05-22 14:56:09.810 [info] MASSIVE SNIP of similar lines to reduce character count 2024-05-22 14:56:09.811 [info] MASSIVE SNIP of similar lines to reduce character count 2024-05-22 14:56:09.863 [info] ======================== 1000 tests collected in 0.19s ========================= 2024-05-22 14:56:14.484 [info] All environment variables set for pytest execution: {"USER":"ubuntu","SSH_CLIENT":"172.19.160.1 54807 22","XDG_SESSION_TYPE":"tty","SHLVL":"0","MOTD_SHOWN":"pam","HOME":"/home/ubuntu","SSL_CERT_FILE":"/usr/lib/ssl/certs/ca-certificates.crt","DBUS_SESSION_BUS_ADDRESS":"unix:path=/run/user/1001/bus","LOGNAME":"ubuntu","_":"/home/ubuntu/.vscode-server/cli/servers/Stable-dc96b837cf6bb4af9cd736aa3af08cf8279f7685/server/node","XDG_SESSION_CLASS":"user","VSCODE_CLI_REQUIRE_TOKEN":"30c43a77-5a4a-4596-a1c8-427121d317a3","XDG_SESSION_ID":"3","VSCODE_AGENT_FOLDER":"/home/ubuntu/.vscode-server","XDG_RUNTIME_DIR":"/run/user/1001","SSL_CERT_DIR":"/usr/lib/ssl/certs","LANG":"C.UTF-8","SHELL":"/bin/bash","PWD":"/home/ubuntu","SSH_CONNECTION":"172.19.160.1 54807 172.19.164.74 22","VSCODE_HANDLES_SIGPIPE":"true","LS_COLORS":"","RALLY_URL":"https://staging.sdvi.com","LESSCLOSE":"/usr/bin/lesspipe %s %s","LESSOPEN":"| /usr/bin/lesspipe %s","XDG_DATA_DIRS":"/usr/local/share:/usr/share:/var/lib/snapd/desktop","STAMP_PERSISTENCE_LOCATION":"/home/ubuntu/.config/sdvi-kick","RALLY_API_TOKEN":"HfzuhYgi6mhcVt+uZE1NovstPolsUt7JuskyvIHDPSYTKCXEghlo2q4m4SwIauu+","VSCODE_AMD_ENTRYPOINT":"vs/workbench/api/node/extensionHostProcess","VSCODE_HANDLES_UNCAUGHT_ERRORS":"true","VSCODE_NLS_CONFIG":"{\"locale\":\"en\",\"osLocale\":\"en\",\"availableLanguages\":{}}","BROWSER":"/home/ubuntu/.vscode-server/cli/servers/Stable-dc96b837cf6bb4af9cd736aa3af08cf8279f7685/server/bin/helpers/browser.sh","VSCODE_CWD":"/home/ubuntu","ELECTRON_RUN_AS_NODE":"1","VSCODE_IPC_HOOK_CLI":"/run/user/1001/vscode-ipc-ec5a8dcc-a31b-43f0-b262-73a2769eef2b.sock","PATH":"/home/ubuntu/.vscode-server/cli/servers/Stable-dc96b837cf6bb4af9cd736aa3af08cf8279f7685/server/bin/remote-cli:/home/ubuntu/.local/bin:/home/ubuntu/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin","PYTHONPATH":"/home/ubuntu/.vscode-server/extensions/ms-python.python-2024.6.0/python_files","TEST_RUN_PIPE":"/run/user/1001/python-test-results-357aa56290738786d2a8.sock","RUN_TEST_IDS_PIPE":"/run/user/1001/python-test-ids-ff738be79173d0d9fa97.sock"} 2024-05-22 14:56:14.484 [info] Running pytest with arguments: /home/ubuntu/.vscode-server/extensions/ms-python.python-2024.6.0/python_files/vscode_pytest/run_pytest_script.py --rootdir=/home/ubuntu/massive-tests for workspace /home/ubuntu/massive-tests 2024-05-22 14:56:14.484 [info] > ./venv/bin/python ~/.vscode-server/extensions/ms-python.python-2024.6.0/python_files/vscode_pytest/run_pytest_script.py --rootdir=. 2024-05-22 14:56:14.484 [info] cwd: . 2024-05-22 14:56:14.852 [error] Subprocess exited unsuccessfully with exit code 1 and signal null on workspace /home/ubuntu/massive-tests 2024-05-22 14:56:14.852 [error] Subprocess closed unsuccessfully with exit code 1 and signal null for workspace /home/ubuntu/massive-tests. Creating and sending error execution payload 2024-05-22 14:59:35.577 [info] All environment variables set for pytest execution: {"USER":"ubuntu","SSH_CLIENT":"172.19.160.1 54807 22","XDG_SESSION_TYPE":"tty","SHLVL":"0","MOTD_SHOWN":"pam","HOME":"/home/ubuntu","SSL_CERT_FILE":"/usr/lib/ssl/certs/ca-certificates.crt","DBUS_SESSION_BUS_ADDRESS":"unix:path=/run/user/1001/bus","LOGNAME":"ubuntu","_":"/home/ubuntu/.vscode-server/cli/servers/Stable-dc96b837cf6bb4af9cd736aa3af08cf8279f7685/server/node","XDG_SESSION_CLASS":"user","VSCODE_CLI_REQUIRE_TOKEN":"30c43a77-5a4a-4596-a1c8-427121d317a3","XDG_SESSION_ID":"3","VSCODE_AGENT_FOLDER":"/home/ubuntu/.vscode-server","XDG_RUNTIME_DIR":"/run/user/1001","SSL_CERT_DIR":"/usr/lib/ssl/certs","LANG":"C.UTF-8","SHELL":"/bin/bash","PWD":"/home/ubuntu","SSH_CONNECTION":"172.19.160.1 54807 172.19.164.74 22","VSCODE_HANDLES_SIGPIPE":"true","LS_COLORS":"","RALLY_URL":"https://staging.sdvi.com","LESSCLOSE":"/usr/bin/lesspipe %s %s","LESSOPEN":"| /usr/bin/lesspipe %s","XDG_DATA_DIRS":"/usr/local/share:/usr/share:/var/lib/snapd/desktop","STAMP_PERSISTENCE_LOCATION":"/home/ubuntu/.config/sdvi-kick","RALLY_API_TOKEN":"HfzuhYgi6mhcVt+uZE1NovstPolsUt7JuskyvIHDPSYTKCXEghlo2q4m4SwIauu+","VSCODE_AMD_ENTRYPOINT":"vs/workbench/api/node/extensionHostProcess","VSCODE_HANDLES_UNCAUGHT_ERRORS":"true","VSCODE_NLS_CONFIG":"{\"locale\":\"en\",\"osLocale\":\"en\",\"availableLanguages\":{}}","BROWSER":"/home/ubuntu/.vscode-server/cli/servers/Stable-dc96b837cf6bb4af9cd736aa3af08cf8279f7685/server/bin/helpers/browser.sh","VSCODE_CWD":"/home/ubuntu","ELECTRON_RUN_AS_NODE":"1","VSCODE_IPC_HOOK_CLI":"/run/user/1001/vscode-ipc-ec5a8dcc-a31b-43f0-b262-73a2769eef2b.sock","PATH":"/home/ubuntu/.vscode-server/cli/servers/Stable-dc96b837cf6bb4af9cd736aa3af08cf8279f7685/server/bin/remote-cli:/home/ubuntu/.local/bin:/home/ubuntu/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin","PYTHONPATH":"/home/ubuntu/.vscode-server/extensions/ms-python.python-2024.6.0/python_files","TEST_RUN_PIPE":"/run/user/1001/python-test-results-33e2bb1cdbb405acbe5f.sock","RUN_TEST_IDS_PIPE":"/run/user/1001/python-test-ids-b84d39e3cb8f968981bb.sock"} 2024-05-22 14:59:35.577 [info] Running pytest with arguments: /home/ubuntu/.vscode-server/extensions/ms-python.python-2024.6.0/python_files/vscode_pytest/run_pytest_script.py --rootdir=/home/ubuntu/massive-tests for workspace /home/ubuntu/massive-tests 2024-05-22 14:59:35.577 [info] > ./venv/bin/python ~/.vscode-server/extensions/ms-python.python-2024.6.0/python_files/vscode_pytest/run_pytest_script.py --rootdir=. 2024-05-22 14:59:35.577 [info] cwd: . 2024-05-22 14:59:35.946 [error] Subprocess exited unsuccessfully with exit code 1 and signal null on workspace /home/ubuntu/massive-tests 2024-05-22 14:59:35.946 [error] Subprocess closed unsuccessfully with exit code 1 and signal null for workspace /home/ubuntu/massive-tests. Creating and sending error execution payload 2024-05-22 15:04:53.458 [info] All environment variables set for pytest execution: {"USER":"ubuntu","SSH_CLIENT":"172.19.160.1 54807 22","XDG_SESSION_TYPE":"tty","SHLVL":"0","MOTD_SHOWN":"pam","HOME":"/home/ubuntu","SSL_CERT_FILE":"/usr/lib/ssl/certs/ca-certificates.crt","DBUS_SESSION_BUS_ADDRESS":"unix:path=/run/user/1001/bus","LOGNAME":"ubuntu","_":"/home/ubuntu/.vscode-server/cli/servers/Stable-dc96b837cf6bb4af9cd736aa3af08cf8279f7685/server/node","XDG_SESSION_CLASS":"user","VSCODE_CLI_REQUIRE_TOKEN":"30c43a77-5a4a-4596-a1c8-427121d317a3","XDG_SESSION_ID":"3","VSCODE_AGENT_FOLDER":"/home/ubuntu/.vscode-server","XDG_RUNTIME_DIR":"/run/user/1001","SSL_CERT_DIR":"/usr/lib/ssl/certs","LANG":"C.UTF-8","SHELL":"/bin/bash","PWD":"/home/ubuntu","SSH_CONNECTION":"172.19.160.1 54807 172.19.164.74 22","VSCODE_HANDLES_SIGPIPE":"true","LS_COLORS":"","RALLY_URL":"https://staging.sdvi.com","LESSCLOSE":"/usr/bin/lesspipe %s %s","LESSOPEN":"| /usr/bin/lesspipe %s","XDG_DATA_DIRS":"/usr/local/share:/usr/share:/var/lib/snapd/desktop","STAMP_PERSISTENCE_LOCATION":"/home/ubuntu/.config/sdvi-kick","RALLY_API_TOKEN":"HfzuhYgi6mhcVt+uZE1NovstPolsUt7JuskyvIHDPSYTKCXEghlo2q4m4SwIauu+","VSCODE_AMD_ENTRYPOINT":"vs/workbench/api/node/extensionHostProcess","VSCODE_HANDLES_UNCAUGHT_ERRORS":"true","VSCODE_NLS_CONFIG":"{\"locale\":\"en\",\"osLocale\":\"en\",\"availableLanguages\":{}}","BROWSER":"/home/ubuntu/.vscode-server/cli/servers/Stable-dc96b837cf6bb4af9cd736aa3af08cf8279f7685/server/bin/helpers/browser.sh","VSCODE_CWD":"/home/ubuntu","ELECTRON_RUN_AS_NODE":"1","VSCODE_IPC_HOOK_CLI":"/run/user/1001/vscode-ipc-ec5a8dcc-a31b-43f0-b262-73a2769eef2b.sock","PATH":"/home/ubuntu/.vscode-server/cli/servers/Stable-dc96b837cf6bb4af9cd736aa3af08cf8279f7685/server/bin/remote-cli:/home/ubuntu/.local/bin:/home/ubuntu/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin","PYTHONPATH":"/home/ubuntu/.vscode-server/extensions/ms-python.python-2024.6.0/python_files","TEST_RUN_PIPE":"/run/user/1001/python-test-results-893e1a3d4779d81e758a.sock","RUN_TEST_IDS_PIPE":"/run/user/1001/python-test-ids-bcf1bbd02489080bbd4c.sock"} 2024-05-22 15:04:53.458 [info] Running pytest with arguments: /home/ubuntu/.vscode-server/extensions/ms-python.python-2024.6.0/python_files/vscode_pytest/run_pytest_script.py --rootdir=/home/ubuntu/massive-tests for workspace /home/ubuntu/massive-tests 2024-05-22 15:04:53.458 [info] > ./venv/bin/python ~/.vscode-server/extensions/ms-python.python-2024.6.0/python_files/vscode_pytest/run_pytest_script.py --rootdir=. 2024-05-22 15:04:53.458 [info] cwd: . 2024-05-22 15:04:55.444 [info] All environment variables set for pytest execution: {"USER":"ubuntu","SSH_CLIENT":"172.19.160.1 54807 22","XDG_SESSION_TYPE":"tty","SHLVL":"0","MOTD_SHOWN":"pam","HOME":"/home/ubuntu","SSL_CERT_FILE":"/usr/lib/ssl/certs/ca-certificates.crt","DBUS_SESSION_BUS_ADDRESS":"unix:path=/run/user/1001/bus","LOGNAME":"ubuntu","_":"/home/ubuntu/.vscode-server/cli/servers/Stable-dc96b837cf6bb4af9cd736aa3af08cf8279f7685/server/node","XDG_SESSION_CLASS":"user","VSCODE_CLI_REQUIRE_TOKEN":"30c43a77-5a4a-4596-a1c8-427121d317a3","XDG_SESSION_ID":"3","VSCODE_AGENT_FOLDER":"/home/ubuntu/.vscode-server","XDG_RUNTIME_DIR":"/run/user/1001","SSL_CERT_DIR":"/usr/lib/ssl/certs","LANG":"C.UTF-8","SHELL":"/bin/bash","PWD":"/home/ubuntu","SSH_CONNECTION":"172.19.160.1 54807 172.19.164.74 22","VSCODE_HANDLES_SIGPIPE":"true","LS_COLORS":"","RALLY_URL":"https://staging.sdvi.com","LESSCLOSE":"/usr/bin/lesspipe %s %s","LESSOPEN":"| /usr/bin/lesspipe %s","XDG_DATA_DIRS":"/usr/local/share:/usr/share:/var/lib/snapd/desktop","STAMP_PERSISTENCE_LOCATION":"/home/ubuntu/.config/sdvi-kick","RALLY_API_TOKEN":"HfzuhYgi6mhcVt+uZE1NovstPolsUt7JuskyvIHDPSYTKCXEghlo2q4m4SwIauu+","VSCODE_AMD_ENTRYPOINT":"vs/workbench/api/node/extensionHostProcess","VSCODE_HANDLES_UNCAUGHT_ERRORS":"true","VSCODE_NLS_CONFIG":"{\"locale\":\"en\",\"osLocale\":\"en\",\"availableLanguages\":{}}","BROWSER":"/home/ubuntu/.vscode-server/cli/servers/Stable-dc96b837cf6bb4af9cd736aa3af08cf8279f7685/server/bin/helpers/browser.sh","VSCODE_CWD":"/home/ubuntu","ELECTRON_RUN_AS_NODE":"1","VSCODE_IPC_HOOK_CLI":"/run/user/1001/vscode-ipc-ec5a8dcc-a31b-43f0-b262-73a2769eef2b.sock","PATH":"/home/ubuntu/.vscode-server/cli/servers/Stable-dc96b837cf6bb4af9cd736aa3af08cf8279f7685/server/bin/remote-cli:/home/ubuntu/.local/bin:/home/ubuntu/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin","PYTHONPATH":"/home/ubuntu/.vscode-server/extensions/ms-python.python-2024.6.0/python_files","TEST_RUN_PIPE":"/run/user/1001/python-test-results-3e04b42d3bf3c51aa193.sock","RUN_TEST_IDS_PIPE":"/run/user/1001/python-test-ids-e8c1ca5c585c68b70b7e.sock"} 2024-05-22 15:04:55.444 [info] Running pytest with arguments: /home/ubuntu/.vscode-server/extensions/ms-python.python-2024.6.0/python_files/vscode_pytest/run_pytest_script.py --rootdir=/home/ubuntu/massive-tests for workspace /home/ubuntu/massive-tests 2024-05-22 15:04:55.444 [info] > ./venv/bin/python ~/.vscode-server/extensions/ms-python.python-2024.6.0/python_files/vscode_pytest/run_pytest_script.py --rootdir=. 2024-05-22 15:04:55.444 [info] cwd: . 2024-05-22 15:04:56.750 [info] All environment variables set for pytest execution: {"USER":"ubuntu","SSH_CLIENT":"172.19.160.1 54807 22","XDG_SESSION_TYPE":"tty","SHLVL":"0","MOTD_SHOWN":"pam","HOME":"/home/ubuntu","SSL_CERT_FILE":"/usr/lib/ssl/certs/ca-certificates.crt","DBUS_SESSION_BUS_ADDRESS":"unix:path=/run/user/1001/bus","LOGNAME":"ubuntu","_":"/home/ubuntu/.vscode-server/cli/servers/Stable-dc96b837cf6bb4af9cd736aa3af08cf8279f7685/server/node","XDG_SESSION_CLASS":"user","VSCODE_CLI_REQUIRE_TOKEN":"30c43a77-5a4a-4596-a1c8-427121d317a3","XDG_SESSION_ID":"3","VSCODE_AGENT_FOLDER":"/home/ubuntu/.vscode-server","XDG_RUNTIME_DIR":"/run/user/1001","SSL_CERT_DIR":"/usr/lib/ssl/certs","LANG":"C.UTF-8","SHELL":"/bin/bash","PWD":"/home/ubuntu","SSH_CONNECTION":"172.19.160.1 54807 172.19.164.74 22","VSCODE_HANDLES_SIGPIPE":"true","LS_COLORS":"","RALLY_URL":"https://staging.sdvi.com","LESSCLOSE":"/usr/bin/lesspipe %s %s","LESSOPEN":"| /usr/bin/lesspipe %s","XDG_DATA_DIRS":"/usr/local/share:/usr/share:/var/lib/snapd/desktop","STAMP_PERSISTENCE_LOCATION":"/home/ubuntu/.config/sdvi-kick","RALLY_API_TOKEN":"HfzuhYgi6mhcVt+uZE1NovstPolsUt7JuskyvIHDPSYTKCXEghlo2q4m4SwIauu+","VSCODE_AMD_ENTRYPOINT":"vs/workbench/api/node/extensionHostProcess","VSCODE_HANDLES_UNCAUGHT_ERRORS":"true","VSCODE_NLS_CONFIG":"{\"locale\":\"en\",\"osLocale\":\"en\",\"availableLanguages\":{}}","BROWSER":"/home/ubuntu/.vscode-server/cli/servers/Stable-dc96b837cf6bb4af9cd736aa3af08cf8279f7685/server/bin/helpers/browser.sh","VSCODE_CWD":"/home/ubuntu","ELECTRON_RUN_AS_NODE":"1","VSCODE_IPC_HOOK_CLI":"/run/user/1001/vscode-ipc-ec5a8dcc-a31b-43f0-b262-73a2769eef2b.sock","PATH":"/home/ubuntu/.vscode-server/cli/servers/Stable-dc96b837cf6bb4af9cd736aa3af08cf8279f7685/server/bin/remote-cli:/home/ubuntu/.local/bin:/home/ubuntu/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin","PYTHONPATH":"/home/ubuntu/.vscode-server/extensions/ms-python.python-2024.6.0/python_files","TEST_RUN_PIPE":"/run/user/1001/python-test-results-16b94daf4bfc026e8d86.sock","RUN_TEST_IDS_PIPE":"/run/user/1001/python-test-ids-19f846efc9f950889689.sock"} 2024-05-22 15:04:56.750 [info] Running pytest with arguments: /home/ubuntu/.vscode-server/extensions/ms-python.python-2024.6.0/python_files/vscode_pytest/run_pytest_script.py --rootdir=/home/ubuntu/massive-tests for workspace /home/ubuntu/massive-tests 2024-05-22 15:04:56.750 [info] > ./venv/bin/python ~/.vscode-server/extensions/ms-python.python-2024.6.0/python_files/vscode_pytest/run_pytest_script.py --rootdir=. 2024-05-22 15:04:56.750 [info] cwd: . 2024-05-22 15:04:58.157 [info] All environment variables set for pytest execution: {"USER":"ubuntu","SSH_CLIENT":"172.19.160.1 54807 22","XDG_SESSION_TYPE":"tty","SHLVL":"0","MOTD_SHOWN":"pam","HOME":"/home/ubuntu","SSL_CERT_FILE":"/usr/lib/ssl/certs/ca-certificates.crt","DBUS_SESSION_BUS_ADDRESS":"unix:path=/run/user/1001/bus","LOGNAME":"ubuntu","_":"/home/ubuntu/.vscode-server/cli/servers/Stable-dc96b837cf6bb4af9cd736aa3af08cf8279f7685/server/node","XDG_SESSION_CLASS":"user","VSCODE_CLI_REQUIRE_TOKEN":"30c43a77-5a4a-4596-a1c8-427121d317a3","XDG_SESSION_ID":"3","VSCODE_AGENT_FOLDER":"/home/ubuntu/.vscode-server","XDG_RUNTIME_DIR":"/run/user/1001","SSL_CERT_DIR":"/usr/lib/ssl/certs","LANG":"C.UTF-8","SHELL":"/bin/bash","PWD":"/home/ubuntu","SSH_CONNECTION":"172.19.160.1 54807 172.19.164.74 22","VSCODE_HANDLES_SIGPIPE":"true","LS_COLORS":"","RALLY_URL":"https://staging.sdvi.com","LESSCLOSE":"/usr/bin/lesspipe %s %s","LESSOPEN":"| /usr/bin/lesspipe %s","XDG_DATA_DIRS":"/usr/local/share:/usr/share:/var/lib/snapd/desktop","STAMP_PERSISTENCE_LOCATION":"/home/ubuntu/.config/sdvi-kick","RALLY_API_TOKEN":"HfzuhYgi6mhcVt+uZE1NovstPolsUt7JuskyvIHDPSYTKCXEghlo2q4m4SwIauu+","VSCODE_AMD_ENTRYPOINT":"vs/workbench/api/node/extensionHostProcess","VSCODE_HANDLES_UNCAUGHT_ERRORS":"true","VSCODE_NLS_CONFIG":"{\"locale\":\"en\",\"osLocale\":\"en\",\"availableLanguages\":{}}","BROWSER":"/home/ubuntu/.vscode-server/cli/servers/Stable-dc96b837cf6bb4af9cd736aa3af08cf8279f7685/server/bin/helpers/browser.sh","VSCODE_CWD":"/home/ubuntu","ELECTRON_RUN_AS_NODE":"1","VSCODE_IPC_HOOK_CLI":"/run/user/1001/vscode-ipc-ec5a8dcc-a31b-43f0-b262-73a2769eef2b.sock","PATH":"/home/ubuntu/.vscode-server/cli/servers/Stable-dc96b837cf6bb4af9cd736aa3af08cf8279f7685/server/bin/remote-cli:/home/ubuntu/.local/bin:/home/ubuntu/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin","PYTHONPATH":"/home/ubuntu/.vscode-server/extensions/ms-python.python-2024.6.0/python_files","TEST_RUN_PIPE":"/run/user/1001/python-test-results-9941f727d4bd867fd846.sock","RUN_TEST_IDS_PIPE":"/run/user/1001/python-test-ids-006c8d607d33af5f1aa0.sock"} 2024-05-22 15:04:58.157 [info] Running pytest with arguments: /home/ubuntu/.vscode-server/extensions/ms-python.python-2024.6.0/python_files/vscode_pytest/run_pytest_script.py --rootdir=/home/ubuntu/massive-tests for workspace /home/ubuntu/massive-tests 2024-05-22 15:04:58.157 [info] > ./venv/bin/python ~/.vscode-server/extensions/ms-python.python-2024.6.0/python_files/vscode_pytest/run_pytest_script.py --rootdir=. 2024-05-22 15:04:58.157 [info] cwd: . 2024-05-22 15:04:59.912 [info] All environment variables set for pytest execution: {"USER":"ubuntu","SSH_CLIENT":"172.19.160.1 54807 22","XDG_SESSION_TYPE":"tty","SHLVL":"0","MOTD_SHOWN":"pam","HOME":"/home/ubuntu","SSL_CERT_FILE":"/usr/lib/ssl/certs/ca-certificates.crt","DBUS_SESSION_BUS_ADDRESS":"unix:path=/run/user/1001/bus","LOGNAME":"ubuntu","_":"/home/ubuntu/.vscode-server/cli/servers/Stable-dc96b837cf6bb4af9cd736aa3af08cf8279f7685/server/node","XDG_SESSION_CLASS":"user","VSCODE_CLI_REQUIRE_TOKEN":"30c43a77-5a4a-4596-a1c8-427121d317a3","XDG_SESSION_ID":"3","VSCODE_AGENT_FOLDER":"/home/ubuntu/.vscode-server","XDG_RUNTIME_DIR":"/run/user/1001","SSL_CERT_DIR":"/usr/lib/ssl/certs","LANG":"C.UTF-8","SHELL":"/bin/bash","PWD":"/home/ubuntu","SSH_CONNECTION":"172.19.160.1 54807 172.19.164.74 22","VSCODE_HANDLES_SIGPIPE":"true","LS_COLORS":"","RALLY_URL":"https://staging.sdvi.com","LESSCLOSE":"/usr/bin/lesspipe %s %s","LESSOPEN":"| /usr/bin/lesspipe %s","XDG_DATA_DIRS":"/usr/local/share:/usr/share:/var/lib/snapd/desktop","STAMP_PERSISTENCE_LOCATION":"/home/ubuntu/.config/sdvi-kick","RALLY_API_TOKEN":"HfzuhYgi6mhcVt+uZE1NovstPolsUt7JuskyvIHDPSYTKCXEghlo2q4m4SwIauu+","VSCODE_AMD_ENTRYPOINT":"vs/workbench/api/node/extensionHostProcess","VSCODE_HANDLES_UNCAUGHT_ERRORS":"true","VSCODE_NLS_CONFIG":"{\"locale\":\"en\",\"osLocale\":\"en\",\"availableLanguages\":{}}","BROWSER":"/home/ubuntu/.vscode-server/cli/servers/Stable-dc96b837cf6bb4af9cd736aa3af08cf8279f7685/server/bin/helpers/browser.sh","VSCODE_CWD":"/home/ubuntu","ELECTRON_RUN_AS_NODE":"1","VSCODE_IPC_HOOK_CLI":"/run/user/1001/vscode-ipc-ec5a8dcc-a31b-43f0-b262-73a2769eef2b.sock","PATH":"/home/ubuntu/.vscode-server/cli/servers/Stable-dc96b837cf6bb4af9cd736aa3af08cf8279f7685/server/bin/remote-cli:/home/ubuntu/.local/bin:/home/ubuntu/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin","PYTHONPATH":"/home/ubuntu/.vscode-server/extensions/ms-python.python-2024.6.0/python_files","TEST_RUN_PIPE":"/run/user/1001/python-test-results-741f0d204e3e4bb90909.sock","RUN_TEST_IDS_PIPE":"/run/user/1001/python-test-ids-c768ad94d8706ac3f0db.sock"} 2024-05-22 15:04:59.912 [info] Running pytest with arguments: /home/ubuntu/.vscode-server/extensions/ms-python.python-2024.6.0/python_files/vscode_pytest/run_pytest_script.py --rootdir=/home/ubuntu/massive-tests for workspace /home/ubuntu/massive-tests 2024-05-22 15:04:59.912 [info] > ./venv/bin/python ~/.vscode-server/extensions/ms-python.python-2024.6.0/python_files/vscode_pytest/run_pytest_script.py --rootdir=. 2024-05-22 15:04:59.912 [info] cwd: . 2024-05-22 15:05:00.286 [error] Subprocess exited unsuccessfully with exit code 1 and signal null on workspace /home/ubuntu/massive-tests 2024-05-22 15:05:00.286 [error] Subprocess closed unsuccessfully with exit code 1 and signal null for workspace /home/ubuntu/massive-tests. Creating and sending error execution payload 2024-05-22 15:31:23.531 [info] > . ./venv/bin/activate && echo 'e8b39361-0157-4923-80e1-22d70d46dee6' && python ~/.vscode-server/extensions/ms-python.python-2024.6.0/python_files/printEnvVariables.py 2024-05-22 15:31:23.531 [info] shell: bash 2024-05-22 15:31:23.553 [info] All environment variables set for pytest execution: {"USER":"ubuntu","SSH_CLIENT":"172.19.160.1 54807 22","XDG_SESSION_TYPE":"tty","SHLVL":"0","MOTD_SHOWN":"pam","HOME":"/home/ubuntu","SSL_CERT_FILE":"/usr/lib/ssl/certs/ca-certificates.crt","DBUS_SESSION_BUS_ADDRESS":"unix:path=/run/user/1001/bus","LOGNAME":"ubuntu","_":"/home/ubuntu/.vscode-server/cli/servers/Stable-dc96b837cf6bb4af9cd736aa3af08cf8279f7685/server/node","XDG_SESSION_CLASS":"user","VSCODE_CLI_REQUIRE_TOKEN":"30c43a77-5a4a-4596-a1c8-427121d317a3","XDG_SESSION_ID":"3","VSCODE_AGENT_FOLDER":"/home/ubuntu/.vscode-server","XDG_RUNTIME_DIR":"/run/user/1001","SSL_CERT_DIR":"/usr/lib/ssl/certs","LANG":"C.UTF-8","SHELL":"/bin/bash","PWD":"/home/ubuntu","SSH_CONNECTION":"172.19.160.1 54807 172.19.164.74 22","VSCODE_HANDLES_SIGPIPE":"true","LS_COLORS":"","RALLY_URL":"https://staging.sdvi.com","LESSCLOSE":"/usr/bin/lesspipe %s %s","LESSOPEN":"| /usr/bin/lesspipe %s","XDG_DATA_DIRS":"/usr/local/share:/usr/share:/var/lib/snapd/desktop","STAMP_PERSISTENCE_LOCATION":"/home/ubuntu/.config/sdvi-kick","RALLY_API_TOKEN":"HfzuhYgi6mhcVt+uZE1NovstPolsUt7JuskyvIHDPSYTKCXEghlo2q4m4SwIauu+","VSCODE_AMD_ENTRYPOINT":"vs/workbench/api/node/extensionHostProcess","VSCODE_HANDLES_UNCAUGHT_ERRORS":"true","VSCODE_NLS_CONFIG":"{\"locale\":\"en\",\"osLocale\":\"en\",\"availableLanguages\":{}}","BROWSER":"/home/ubuntu/.vscode-server/cli/servers/Stable-dc96b837cf6bb4af9cd736aa3af08cf8279f7685/server/bin/helpers/browser.sh","VSCODE_CWD":"/home/ubuntu","ELECTRON_RUN_AS_NODE":"1","VSCODE_IPC_HOOK_CLI":"/run/user/1001/vscode-ipc-ec5a8dcc-a31b-43f0-b262-73a2769eef2b.sock","PATH":"/home/ubuntu/.vscode-server/cli/servers/Stable-dc96b837cf6bb4af9cd736aa3af08cf8279f7685/server/bin/remote-cli:/home/ubuntu/.local/bin:/home/ubuntu/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin","PYTHONPATH":"/home/ubuntu/.vscode-server/extensions/ms-python.python-2024.6.0/python_files","TEST_RUN_PIPE":"/run/user/1001/python-test-results-5eb85d080f27d26f6757.sock","RUN_TEST_IDS_PIPE":"/run/user/1001/python-test-ids-52ab3c0b5f095d1011d6.sock"} 2024-05-22 15:31:23.553 [info] Running pytest with arguments: /home/ubuntu/.vscode-server/extensions/ms-python.python-2024.6.0/python_files/vscode_pytest/run_pytest_script.py --rootdir=/home/ubuntu/massive-tests for workspace /home/ubuntu/massive-tests 2024-05-22 15:31:23.553 [info] > ./venv/bin/python ~/.vscode-server/extensions/ms-python.python-2024.6.0/python_files/vscode_pytest/run_pytest_script.py --rootdir=. 2024-05-22 15:31:23.553 [info] cwd: . 2024-05-22 15:31:23.919 [error] Subprocess exited unsuccessfully with exit code 1 and signal null on workspace /home/ubuntu/massive-tests 2024-05-22 15:31:23.919 [error] Subprocess closed unsuccessfully with exit code 1 and signal null for workspace /home/ubuntu/massive-tests. Creating and sending error execution payload ```

Extension version: 2024.6.0 VS Code version: Code 1.89.1 (dc96b837cf6bb4af9cd736aa3af08cf8279f7685, 2024-05-07T05:13:33.891Z) OS version: Windows_NT x64 10.0.22621 Modes: Remote OS version: Linux x64 5.4.0-182-generic

User Settings

``` languageServer: "Pylance" testing • pytestArgs: "" • pytestEnabled: true ```

Installed Extensions |Extension Name|Extension Id|Version| |---|---|---| |JavaScript Debugger|ms-vscode.js-debug|1.89.0| |Pylance|ms-python.vscode-pylance|2024.5.1| |Python|ms-python.python|2024.6.0| |Python Debugger|ms-python.debugpy|2024.6.0| |Table Visualizer for JavaScript Profiles|ms-vscode.vscode-js-profile-table|1.0.9|
System Info |Item|Value| |---|---| |CPUs|12th Gen Intel(R) Core(TM) i5-12400 (12 x 2496)| |GPU Status|2d_canvas: enabled
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled| |Load (avg)|undefined| |Memory (System)|79.77GB (20.81GB free)| |Process Argv|--crash-reporter-id ff832b7f-59a5-42ed-85aa-a6b3f927800b| |Screen Reader|no| |VM|0%| |Item|Value| |---|---| |Remote|SSH: sdvi| |OS|Linux x64 5.4.0-182-generic| |CPUs|12th Gen Intel(R) Core(TM) i5-12400 (6 x 4119)| |Memory (System)|39.18GB (37.39GB free)| |VM|0%|
A/B Experiments ``` vsliv368:30146709 vspor879:30202332 vspor708:30202333 vspor363:30204092 vscod805cf:30301675 binariesv615:30325510 vsaa593cf:30376535 py29gd2263:31024239 vscaat:30438848 c4g48928:30535728 azure-dev_surveyone:30548225 962ge761:30959799 pythongtdpath:30769146 welcomedialog:30910333 pythonidxpt:30866567 pythonnoceb:30805159 asynctok:30898717 pythontestfixt:30902429 pythonregdiag2:30936856 pythonmypyd1:30879173 pythoncet0:30885854 2e7ec940:31000449 pythontbext0:30879054 accentitlementsc:30995553 dsvsc016:30899300 dsvsc017:30899301 dsvsc018:30899302 cppperfnew:31000557 dsvsc020:30976470 pythonait:31006305 666c4381:30973075 chatpanelt:31048053 dsvsc021:30996838 da93g388:31013173 pythoncenvptcf:31049071 a69g1124:31046351 dvdeprecation:31052039 pythonprc:31047982 dwnewjupyter:31046869 26j00206:31048877 ```
eleanorjboyd commented 3 months ago

Sorry for the delay- I will look at this soon.

eleanorjboyd commented 2 months ago

Thanks for the detailed issue and great that you found a solution! We are switching to not reading from a socket soon as part of another low-level architecture change so this won't be an issue longterm but Ill add in your solution for the time being until that changes.

tongfa commented 2 months ago

Here is another version which gives up after trying to read 3 additional bytes.

--- python_files/testing_tools/socket_manager.py.orig   2024-06-11 15:45:12.324373743 -0600
+++ python_files/testing_tools/socket_manager.py        2024-06-13 21:38:04.245285586 -0600
@@ -69,10 +69,21 @@
             return self._reader.read(bufsize)
         else:
             # receive bytes and convert to string
+            part: bytes = self._socket.recv(bufsize)
+            # unicode codepoints can be up to 4 bytes when encoded.
+            # worst case scenario is we read the first of 4,
+            # so that's three more tries.
+            max_try_count = 3
             while True:
-                part: bytes = self._socket.recv(bufsize)
-                data: str = part.decode("utf-8")
-                return data
+                try:
+                    data = part.decode("utf-8")
+                    return data
+                except UnicodeDecodeError:
+                    if max_try_count == 0:
+                        raise
+                    # try reading one more byte
+                    part += self._socket.recv(1)
+                    max_try_count -= 1

 class SocketManager(object):

thank you!

tongfa commented 1 week ago

We are about to release our development environment that exposes this issue to a broader set of developers. Is there anything you can tell us around timing of the patch being included in a future update?

thanks again!

eleanorjboyd commented 1 week ago

Hi! Here is the issue about it which we will keep updating https://github.com/microsoft/vscode-python/issues/23279. I will pull in @karthiknadig since he is making this change and probably has a better sense of timeline. Thanks!

tongfa commented 1 week ago

Hello eleanorjboyd!

23279 appears to be the longer-term solution. I was hoping that in the mean time the patch I posted on June 13 could be included as an interim fix. Is that a possibility? ty!