Testing Help - are my tests stuck?

Hello, I am interested in contributing to Python and have been following the developer guide on the master branch (on my fork), but have run into trouble running the unit tests.

I ran the unit tests using the command in the guide: ./python -m test -j3

I am running it on WSL Ubuntu, all seemed to be ok initially but then it seemed to get stuck on this:
.... 2:31:27 load avg: 0.52 running: test_ssl (2 hour 22 min), test_selectors (2 hour 23 min) 2:31:57 load avg: 0.52 running: test_ssl (2 hour 23 min), test_selectors (2 hour 24 min) 2:32:27 load avg: 0.52 running: test_ssl (2 hour 23 min), test_selectors (2 hour 24 min)

After 2 and a half hours, I stopped the process. Is this normal? How long do the unit tests normally take?

I am currently interested in making modifications to the ipaddress module so interseted in knowing which unit tests I should run for that.


Depends on the machine. If you look at our CI it can complete a test suite run in under half an hour: Actions · python/cpython · GitHub.

1 Like

Hm ok thanks. So what is causing this? As all I’ve done is fork the repo, build it and then run the tests, no code changes have been made.

It will depend on your setup/OS/etc. You will need to run those tests manually to see why they are hanging like they are (part of contributing to Python :slight_smile:).

Check which version of OpenSSL is being used by your Python build. IIRC, there was an issue with an early version of OpenSSL 1.1.1 that caused test_ssl to never complete. The problem does not exist with the most recent releases of OpenSSL.

1 Like

Thanks, I just finished work and checked now:

You sir, are a genius.

I will upgrade my OpenSSL and try again.

So an update, I upgraded to OpenSSL 1.1.1f but noticed I had more build errors, after looking into that I realised that I had not installed the build tools. I somehow missed that step as I was only following the steps here: https://devguide.python.org/ and not the linked setup guide here: 1. Getting Started — Python Developer's Guide

Now that I have followed the setup guide and installed all the dependencies too, things seem to be better. However, I am getting a hang on the test_selectors test and also got quite a few other failures too:
test_asyncio test_asyncore test_concurrent_futures test_eintr test_epoll test_fcntl test_ftplib test_httplib test_httpservers test_import test_mmap test_multiprocessing_fork test_multiprocessing_forkserver test_multiprocessing_main_handling test_multiprocessing_spawn test_os test_posix test_signal test_socket test_ssl test_subprocess test_time test_unicode_file

Will try to see what else the problem is now.