pytest-dev / pytest-timeout

MIT License
206 stars 63 forks source link

[question] hook for executing small bit of code before timeout fires #168

Closed alexandruy2k closed 6 months ago

alexandruy2k commented 6 months ago

Hi,

I've started having pytest timeout firing in my regressions in tests that used to execute fine. I've been looking at my logs and I can't see where my testcases are freezing. It looks like maybe I've done something wrong and pytest timeout fires a lot quicker than I expect but I'm not too sure.

This doesn't happen all the time and it's hard to reproduce.

I'm using loguru in my regression running inside a CI system and I can see the timestamps of all the bits happening from my tests but I can't tell at what exact time the tests timeout.

So I'm hoping to just add a loguru print just before the test is killed and that way I can hopefully figure out where my test is stuck.

Or is there another way to get the system time for the timeout somewhere else?

flub commented 6 months ago

When triggered the test output should include the timeout that was used.

I'm afraid this is the wrong forum for these kind of questions, I'd prefer to only get issues here.