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

Random doctest failure in continued_fraction_gosper #33039

Closed
kliem opened this issue Dec 17, 2021 · 12 comments
Closed

Random doctest failure in continued_fraction_gosper #33039

kliem opened this issue Dec 17, 2021 · 12 comments

Comments

@kliem
Copy link
Contributor

kliem commented Dec 17, 2021

sage -t --long --random-seed=129865150212556213443045001147722733023 src/sage/rings/continued_fraction_gosper.py
**********************************************************************
File "src/sage/rings/continued_fraction_gosper.py", line 109, in sage.rings.continued_fraction_gosper.gosper_iterator.__iter__
Failed example:
    lg = [next(ig) for _ in range(10)]; lcf = [next(icf) for _ in range(10)];
Exception raised:
    Traceback (most recent call last):
      File "/home/jonathan/Applications/sage/local/lib/python3.8/site-packages/sage/doctest/forker.py", line 694, in _run
        self.compile_and_execute(example, compiler, test.globs)
      File "/home/jonathan/Applications/sage/local/lib/python3.8/site-packages/sage/doctest/forker.py", line 1088, in compile_and_execute
        exec(compiled, globs)
      File "<doctest sage.rings.continued_fraction_gosper.gosper_iterator.__iter__[4]>", line 1, in <module>
        lg = [next(ig) for _ in range(Integer(10))]; lcf = [next(icf) for _ in range(Integer(10))];
      File "<doctest sage.rings.continued_fraction_gosper.gosper_iterator.__iter__[4]>", line 1, in <listcomp>
        lg = [next(ig) for _ in range(Integer(10))]; lcf = [next(icf) for _ in range(Integer(10))];
      File "/home/jonathan/Applications/sage/local/lib/python3.8/site-packages/sage/rings/continued_fraction_gosper.py", line 138, in __next__
        raise StopIteration
    StopIteration
**********************************************************************
File "src/sage/rings/continued_fraction_gosper.py", line 110, in sage.rings.continued_fraction_gosper.gosper_iterator.__iter__
Failed example:
    lg == lcf
Exception raised:
    Traceback (most recent call last):
      File "/home/jonathan/Applications/sage/local/lib/python3.8/site-packages/sage/doctest/forker.py", line 694, in _run
        self.compile_and_execute(example, compiler, test.globs)
      File "/home/jonathan/Applications/sage/local/lib/python3.8/site-packages/sage/doctest/forker.py", line 1088, in compile_and_execute
        exec(compiled, globs)
      File "<doctest sage.rings.continued_fraction_gosper.gosper_iterator.__iter__[5]>", line 1, in <module>
        lg == lcf
    NameError: name 'lg' is not defined
**********************************************************************
File "src/sage/rings/continued_fraction_gosper.py", line 125, in sage.rings.continued_fraction_gosper.gosper_iterator.__next__
Failed example:
    for i in range(10):
        assert next(ig) == next(icf)
Exception raised:
    Traceback (most recent call last):
      File "/home/jonathan/Applications/sage/local/lib/python3.8/site-packages/sage/doctest/forker.py", line 694, in _run
        self.compile_and_execute(example, compiler, test.globs)
      File "/home/jonathan/Applications/sage/local/lib/python3.8/site-packages/sage/doctest/forker.py", line 1088, in compile_and_execute
        exec(compiled, globs)
      File "<doctest sage.rings.continued_fraction_gosper.gosper_iterator.__next__[4]>", line 2, in <module>
        assert next(ig) == next(icf)
      File "/home/jonathan/Applications/sage/local/lib/python3.8/site-packages/sage/rings/continued_fraction_gosper.py", line 138, in __next__
        raise StopIteration
    StopIteration
**********************************************************************
2 items had failures:
   2 of   7 in sage.rings.continued_fraction_gosper.gosper_iterator.__iter__
   1 of   6 in sage.rings.continued_fraction_gosper.gosper_iterator.__next__
    [40 tests, 3 failures, 0.04 s]
----------------------------------------------------------------------
sage -t --long --random-seed=129865150212556213443045001147722733023 src/sage/rings/continued_fraction_gosper.py  # 3 doctests failed
----------------------------------------------------------------------

Component: doctest framework

Author: Jonathan Kliem

Branch/Commit: ae80b6d

Reviewer: Frédéric Chapoton

Issue created by migration from https://trac.sagemath.org/ticket/33039

@kliem kliem added this to the sage-9.5 milestone Dec 17, 2021
@kliem
Copy link
Contributor Author

kliem commented Dec 17, 2021

Commit: 6a56bb5

@kliem
Copy link
Contributor Author

kliem commented Dec 17, 2021

New commits:

6a56bb5fix unstable doctest in continued_fraction_gosper

@kliem
Copy link
Contributor Author

kliem commented Dec 17, 2021

Branch: public/33039

@kliem
Copy link
Contributor Author

kliem commented Dec 17, 2021

Author: Jonathan Kliem

@fchapoton
Copy link
Contributor

comment:2

break rather than pass, maybe ?

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Dec 18, 2021

Changed commit from 6a56bb5 to ae80b6d

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Dec 18, 2021

Branch pushed to git repo; I updated commit sha1. New commits:

ae80b6dslightly improve doctests

@kliem
Copy link
Contributor Author

kliem commented Dec 18, 2021

comment:4

I also added a new doctest for __next__, as it is completely pointless to have two times the same tests.

@fchapoton
Copy link
Contributor

comment:5

ok, thanx

@fchapoton
Copy link
Contributor

Reviewer: Frédéric Chapoton

@slel
Copy link
Member

slel commented Jan 30, 2022

comment:6

Setting milestone to 9.6 now that 9.5 is out.

@slel slel modified the milestones: sage-9.5, sage-9.6 Jan 30, 2022
@vbraun
Copy link
Member

vbraun commented Feb 12, 2022

Changed branch from public/33039 to ae80b6d

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants