agronholm / apscheduler

Task scheduling library for Python
MIT License
6.31k stars 713 forks source link

Fix test_executor failing tests when using python 3.14 #990

Closed majamassarini closed 1 week ago

majamassarini commented 1 week ago

Fedora is introducing python 3.14 and some tests are failing: https://bugzilla.redhat.com/show_bug.cgi?id=2325181

Should fix https://bugzilla.redhat.com/show_bug.cgi?id=2325181

Changes

As far as I can understand it, this are the issues:

agronholm commented 1 week ago

I've pushed a ton of updates to the 3.x branch. Would you mind merging them to this branch?

agronholm commented 1 week ago

The root cause seems to have been that in 3.14, ProcessPoolExecutor uses the spawn method instead of fork, so the time freeze fixture could not affect the subprocess. I've adjusted the tests accordingly in the updated code, in addition to forcing the use of spawn instead of fork in the executor.

agronholm commented 1 week ago

I just ran the tests on 3.14.0a1 and the executor tests all passed after today's code changes, so doesn't look like this PR is necessary. I'm going to close it, but let me know if you find otherwise.

majamassarini commented 6 days ago

Could you release a new apscheduler 3.10.5 (or whatever version you think is right) so I can package it downstream with your fixes?

Thank you.

agronholm commented 6 days ago

I'll make a release soon. I just have a few more changes to add to it.