wxWidgets / Phoenix

wxPython's Project Phoenix. A new implementation of wxPython, better, stronger, faster than he was before.
http://wxpython.org/
2.28k stars 514 forks source link

Tests behaving strangely with timeout #1316

Open deliciouslytyped opened 5 years ago

deliciouslytyped commented 5 years ago

See https://github.com/NixOS/nixpkgs/pull/64047/#issuecomment-516108491, what is the correct way to run tests? What is going on with the timeout behaviour?

My suite seems to hang on unittests/test_lib_agw_piectrl.py::lib_agw_piectrl_Tests::test_lib_agw_piectrlCtor PASSED [ 44%] which is why I wanted to enable timeouts. (Unless I misinterpreted something earlier)

RobinD42 commented 5 years ago

Running all the tests en masse has never really worked well. It has to do with trying to use wx in the test cases in a way that it wasn't really meant to be used. Originally it had to do with creating and destroying more than one wx.App as the test cases were run, but even switching to pytests boxed plugin to run each test in a separate process there are still issues related to not running an event loop (I think). Most of the time running one test module at a time works fine, but trying to run them all will almost certainly have odd failures, or things will lock up and time out. I expect that there's a way to make things work better, but it hasn't been discovered yet.

deliciouslytyped commented 5 years ago

Do you have any idea where the crosstalk is? We could try further isolating them. Or get the bigger namespace hammer but I'm not sure how well that would work for me.

RobinD42 commented 5 years ago

No, it's been a while since I dug into it. I don't recall most of the details at the moment.

deliciouslytyped commented 4 years ago

I might take a shot at namespacing the tests, is there some way I can get a list of tests and call them individually?

deliciouslytyped commented 4 years ago

By the way, I misunderstood originally, it seems tests are indeed already --boxed by default (a feature of pytest-xdist)