Skip to content

Conversation

@peterjpxie
Copy link
Contributor

@peterjpxiepeterjpxie commented Jan 30, 2023

1/ Add socket server timeout to ThreadedVSOCKSocketStreamTest so that it does not hang on client connection failure, e.g. on WSL.

After adding the timeout, it was able to fail on this test and continue as follows.

./python -m test -v test.test_socket2 ====================================================================== ERROR: testStream (test.test_socket2.ThreadedVSOCKSocketStreamTest.testStream) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/peter/repo/cpython/Lib/test/test_socket2.py", line 376, in _setUp self.__setUp() File "/home/peter/repo/cpython/Lib/test/test_socket2.py", line 522, in setUp self.conn, self.connaddr = self.serv.accept() ^^^^^^^^^^^^^^^^^^ File "/home/peter/repo/cpython/Lib/socket.py", line 295, in accept fd, addr = self._accept() ^^^^^^^^^^^^^^ TimeoutError: timed out ====================================================================== ERROR: testStream (test.test_socket2.ThreadedVSOCKSocketStreamTest.testStream) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/peter/repo/cpython/Lib/test/test_socket2.py", line 364, in raise_queued_exception raise self.queue.get() File "/home/peter/repo/cpython/Lib/test/test_socket2.py", line 388, in clientRun self.clientSetUp() File "/home/peter/repo/cpython/Lib/test/test_socket2.py", line 535, in clientSetUp self.cli.connect((cid, VSOCKPORT)) OSError: [Errno 101] Network is unreachable ---------------------------------------------------------------------- Ran 724 tests in 41.724s FAILED (errors=2, skipped=65) test test.test_socket2 failed test.test_socket2 failed (2 errors) in 41.8 sec == Tests result: FAILURE == 1 test failed: test.test_socket2 Total duration: 41.9 sec Tests result: FAILURE 

2/ Furthermore, as it does not work on WSL (OSError: [Errno 101] Network is unreachable), skip it on WSL.

This works on VMware workstation for communication between VM guests and host.

@ghost
Copy link

ghost commented Jan 30, 2023

The following commit authors need to sign the Contributor License Agreement:

  • peter@Xiaomi-ShaWuJing

Click the button to sign:
CLA not signed

@peterjpxie
Copy link
ContributorAuthor

Forgot to set user.email and user.name and it ends up with a invalid author peter@Xiaomi-ShaWuJing that I can't sign the CLA, close it and will re-do it.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting reviewtestsTests in the Lib/test dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@peterjpxie@bedevere-bot