Skip to content

src/sage/geometry/cone.py: speed up a random_cone() test #40384

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

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

orlitzky
Copy link
Contributor

@orlitzky orlitzky commented Jul 7, 2025

We have two random_cone() tests that test hard-to-reach code paths. Usually these will run for a long time, until we get lucky. But testing these code paths does not actually require randomization -- we need only a random seed that triggers the desired path. This commit combines the two slow tests, and chooses a random seed (for those tests only) that makes them succeed quickly.

We have two random_cone() tests that test hard-to-reach code
paths. Usually these will run for a long time, until we get lucky. But
testing these code paths does not actually require randomization -- we
need only a random seed that triggers the desired path. This commit
combines the two slow tests, and chooses a random seed (for those
tests only) that makes them succeed quickly.
@orlitzky orlitzky requested a review from user202729 July 7, 2025 10:40
@user202729
Copy link
Contributor

Looks reasonable, can set to good once tests pass. (currently the documentation build CI fails, but this part is only in the test anyway i.e. no documentation change)

@orlitzky
Copy link
Contributor Author

orlitzky commented Jul 8, 2025

Thanks, the one failing CI is unrelated:

----------------------------------------------------------------------
sage -t --warn-long 5.0 --random-seed=269487137081349097202272702084876371103 src/sage/libs/singular/function.pyx  # SignalError in doctesting framework
sage -t --warn-long 5.0 --random-seed=269487137081349097202272702084876371103 src/sage/rings/polynomial/plural.pyx  # 6 doctests failed
----------------------------------------------------------------------

vbraun pushed a commit to vbraun/sage that referenced this pull request Jul 14, 2025
sagemathgh-40384: src/sage/geometry/cone.py: speed up a random_cone() test
    
We have two `random_cone()` tests that test hard-to-reach code paths.
Usually these will run for a long time, until we get lucky. But testing
these code paths does not actually require randomization -- we need only
a random seed that triggers the desired path. This commit combines the
two slow tests, and chooses a random seed (for those tests only) that
makes them succeed quickly.
    
URL: sagemath#40384
Reported by: Michael Orlitzky
Reviewer(s):
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.

2 participants