-
-
Notifications
You must be signed in to change notification settings - Fork 498
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix alarm tests #39142
base: develop
Are you sure you want to change the base?
Fix alarm tests #39142
Conversation
Documentation preview for this PR (built with commit 84bf139; changes) is ready! 🎉 |
cf96408
to
5b6e04d
Compare
There are a few failing tests. Some of them, I've seen before (randomly, like the one in qqbar) but others seem to be new. |
On make-based build system, there's only the missing warning one. Edit: this warning sometimes appear and sometimes not. The easiest way to test is probably to suppress the warning. On conda… the only new one I can see is in doctest/util.py. It's about the function takes way too long compared to expected. Edit: sometimes it takes shorter than expected instead https://github.com/sagemath/sage/actions/runs/12404238773/job/34629083816?pr=39142 . Need to investigate. It is true that sometimes the alarm()/cancel_alarm() takes an unreasonably long time though, I can even reproduce that locally (surely it should only takes meson has been failing everywhere nowadays. (presumably #39139 which should be merged soon) I got most of the tests to pass, except a few that uses Python |
5b6e04d
to
abb8d01
Compare
da541cd
to
cdba9cd
Compare
This should be ready for review now. The (fixed) test failures on Mac is weird, but my best guess is context switching (as explained in the comment). The framework would be useful for e.g. #39075 (to determine how much buffer time is needed when test computer is too fast), so it would be helpful if someone can review this one quickly. |
The changes look good to me. Do you have an idea where the (random?) timeout error in the ci is coming from? |
No idea actually. But then, before the patch This time around it is triggered by
Also the random truncation. |
Okay, the same error indeed happens also elsewhere and I've opened to keep track of it #39183 Could you please add a sentence or two to the developer guide, otherwise it looks good to go from my side. |
@tobiasdiez The problem is the current best place to put it is https://cysignals.readthedocs.io/en/latest/sigadvanced.html so… need to ask e.g. @dimpase I suppose. Just have 1-2 sentence mentioning the function name should be sufficient. I hope the docstring is descriptive enough. I suggest
|
Sorry, should have been more precise. I meant adding a short remark here https://doc.sagemath.org/html/en/developer/coding_basics.html#writing-testable-examples, explaining how to test that a method can be interrupted using the helper you introduced. |
As discussed in https://gist.github.com/user202729/52b0c7134ea34f78a4416cd19e28e578#checking-the-code-is-indeed-interruptable , the current doctest of SageMath that tests
sage: alarm(0.5); f()
only checks whetherf
can be interrupted within 10 minutes or whatever the doctest time limit is — which is not particularly useful.With this change, if
f
doesn't get interrupted within 0.2 second ofalarm()
fired, a test failure will be reported.📝 Checklist
⌛ Dependencies