Skip to content
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 tests with gmp 6.3 #36006

Merged
merged 3 commits into from
Sep 10, 2023
Merged

Fix tests with gmp 6.3 #36006

merged 3 commits into from
Sep 10, 2023

Conversation

antonio-rojas
Copy link
Contributor

With gmp 6.3, overflow errors are raised as FloatingPointError

@kiwifb
Copy link
Member

kiwifb commented Jul 31, 2023

That feels like another instance of testing an external component rather than sage itself. I'll have a closer look.

@tornaria
Copy link
Contributor

LGTM

@vbraun
Copy link
Member

vbraun commented Aug 23, 2023

The CI fails. Please don't ask me to merge tickets in that case.

@tornaria
Copy link
Contributor

The CI fails. Please don't ask me to merge tickets in that case.

TBH, I always ignore CI, since it's broken most of the time. Look:
https://github.com/sagemath/sage/pulls?q=is%3Apr+is%3Aopen+label%3A%22s%3A+positive+review%22
I see only 1 out of 39 that passes CI (?!)

I tested this PR locally, and I'm preparing the void linux package for 10.1 which needs this.

I'm not willing to download, build or test sage-the-monolith myself. When sagemath CI starts working consistently, I will stop ignoring it.

I would warmly approve if you had a rule not to merge PRs without a green checkmark, since that would mean breaking CI would be a serious issue.

src/sage/ext/memory.pyx Outdated Show resolved Hide resolved
@github-actions
Copy link

github-actions bot commented Sep 1, 2023

Documentation preview for this PR (built with commit 0d5506d; changes) is ready! 🎉

....: 2^(2^63-3)
....: except (OverflowError, RuntimeError, FloatingPointError):
....: print ('Overflow error')
...Overflow error
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It'd be nice to have some explanation for the ... since it looks like we're already trying to list all of the possible errors and replace them with 'Overflow error'

Otherwise, the CI is happy now...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIRC the old gmp used to actually print some stuff in addition to an error; in the previous form of the test this would be catched by the ... of the traceback.

It'd feel better if sagemath would catch all these variations and return always the same exception (say OverflowError), then the doctest would document precisely what happens (unlike here where the doctest is documenting that different things can happen but we don't know which one).

I think getting this merged is still a win. Whoever feels inclined can improve this in a separate PR.

@tornaria tornaria mentioned this pull request Sep 10, 2023
3 tasks
@vbraun vbraun merged commit 5e841de into sagemath:develop Sep 10, 2023
13 checks passed
@antonio-rojas antonio-rojas deleted the gmp-6.3 branch September 10, 2023 22:48
@mkoeppe mkoeppe added this to the sage-10.2 milestone Sep 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants