Python tests hang on Windows

We have a Python project with Windows tests that pass locally (Win 10 Pro) but hang in Travis, and we’re mystified as to what might be the cause. You can read the failing build log here.

While, at first glance, it might appear that the hanging test is calling a new process (vim), the method is patched to prevent new processes from spawning, and I’ve confirmed that this isn’t happening locally. So unless unittest.mock somehow works differently on Travis, and vim is installed in the Windows VM (seems unlikely), I don’t think this is the cause.

I’ve also read through a dozen or so other threads on Windows builds hanging and none of them seem to explain what’s going on here. There are no secrets in the output, and I can’t set filter_secrets: false because secrets are necessary for other non-Windows steps of the process (unless it’s possible to do this for Windows only?).

Any ideas on what to try next are appreciated. If we remove the two hanging tests, the rest of the test run fine, but it’s hard to tell what’s special about these two versus the others.

Debugging is my best idea. Pinpoint where exactly it hangs by logging progress, then collect ever more info on what’s happening until you know.

Imprint