Skip to content

Conversation

@user202729
Copy link
Contributor

Fix #30379 .

The implementation mimic acb_calc_func_callback.

also increase tolerance for a few parts, since the CI system is somewhat unreliable (I've seen a 2.00 being 2.04). I guess 0.1s is still considered almost imperceptible by human.

📝 Checklist

  • The title is concise and informative.
  • The description explains in detail what this PR is about.
  • I have linked a relevant issue or discussion.
  • I have created tests covering the changes.
  • I have updated the documentation and checked the documentation preview.

⌛ Dependencies

@github-actions
Copy link

github-actions bot commented Oct 4, 2025

Documentation preview for this PR (built with commit b66d785; changes) is ready! 🎉
This preview will update shortly after each push to this PR.

@tobiasdiez
Copy link
Contributor

Just got this:

src/bin/sage -t --warn-long 5.0 --random-seed=13341543192946447292488981102614601354 src/sage/doctest/util.py
**********************************************************************
Error: Failed example:: Got: 
cysignals.signals.AlarmInterrupt

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/runner/miniconda3/envs/sage-dev/lib/python3.13/site-packages/sage/doctest/forker.py", line 734, in _run
    self.compile_and_execute(example, compiler, test.globs)
    ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/runner/miniconda3/envs/sage-dev/lib/python3.13/site-packages/sage/doctest/forker.py", line 1158, in compile_and_execute
    exec(compiled, globs)
    ~~~~^^^^^^^^^^^^^^^^^
  File "<doctest sage.doctest.util.inaccuracy_tolerance[12]>", line 1, in <module>
    with ensure_interruptible_after(Integer(1)): uninterruptible_sleep(2); raise RuntimeError
         ~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^
  File "/Users/runner/miniconda3/envs/sage-dev/lib/python3.13/contextlib.py", line 162, in __exit__
    self.gen.throw(value)
    ~~~~~~~~~~~~~~^^^^^^^
  File "/Users/runner/miniconda3/envs/sage-dev/lib/python3.13/site-packages/sage/doctest/util.py", line 897, in ensure_interruptible_after
    raise RuntimeError(
            f"Function is not interruptible within {seconds:.4f} seconds, only after {elapsed:.4f} seconds"
            + ("" if alarm_raised else " (__exit__ called before interrupt check)"))
RuntimeError: Function is not interruptible within 1.0000 seconds, only after 2.1566 seconds

    with ensure_interruptible_after(1): uninterruptible_sleep(2r); raise RuntimeError
Expected:
    Traceback (most recent call last):
    ...
    RuntimeError: Function is not interruptible within 1.0000 seconds, only after 2.00... seconds
Got:
    <BLANKLINE>
    cysignals.signals.AlarmInterrupt
    <BLANKLINE>
    During handling of the above exception, another exception occurred:
    <BLANKLINE>
    Traceback (most recent call last):
      File "/Users/runner/miniconda3/envs/sage-dev/lib/python3.13/site-packages/sage/doctest/forker.py", line 734, in _run
        self.compile_and_execute(example, compiler, test.globs)
        ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/Users/runner/miniconda3/envs/sage-dev/lib/python3.13/site-packages/sage/doctest/forker.py", line 1158, in compile_and_execute
        exec(compiled, globs)
        ~~~~^^^^^^^^^^^^^^^^^
      File "<doctest sage.doctest.util.inaccuracy_tolerance[12]>", line 1, in <module>
        with ensure_interruptible_after(Integer(1)): uninterruptible_sleep(2); raise RuntimeError
             ~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^
      File "/Users/runner/miniconda3/envs/sage-dev/lib/python3.13/contextlib.py", line 162, in __exit__
        self.gen.throw(value)
        ~~~~~~~~~~~~~~^^^^^^^
      File "/Users/runner/miniconda3/envs/sage-dev/lib/python3.13/site-packages/sage/doctest/util.py", line 897, in ensure_interruptible_after
        raise RuntimeError(
                f"Function is not interruptible within {seconds:.4f} seconds, only after {elapsed:.4f} seconds"
                + ("" if alarm_raised else " (__exit__ called before interrupt check)"))
    RuntimeError: Function is not interruptible within 1.0000 seconds, only after 2.1566 seconds
**********************************************************************
1 item had failures:
   1 of  17 in sage.doctest.util.inaccuracy_tolerance

https://github.com/sagemath/sage/actions/runs/18576442855/job/52962606814

so the increase in tolerance would be not enough. Maybe there is an actual issue here?

@user202729
Copy link
Contributor Author

sounds like one of these extremely-difficult-to-debug issue. Given that I also can't reproduce it internally, I'd guess that GitHub CI machines are some virtual machine thing and may need to compete with other virtual machines concurrently running, which would explain the (extreme) fluctuation.

@user202729
Copy link
Contributor Author

I suspect garbage collector. Let's see if #41072 helps.

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.

Surprising error in numerical integration

2 participants