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 two random test failures in graphs #32772

Closed
kliem opened this issue Oct 26, 2021 · 8 comments
Closed

Fix two random test failures in graphs #32772

kliem opened this issue Oct 26, 2021 · 8 comments

Comments

@kliem
Copy link
Contributor

kliem commented Oct 26, 2021

Part of #32544:

sage -t --long --random-seed=180924489930967511277954046005685261728 src/sage/graphs/base/sparse_graph.pyx
**********************************************************************
File "src/sage/graphs/base/sparse_graph.pyx", line 1163, in sage.graphs.base.sparse_graph._test_adjacency_sequence_out
Failed example:
    _test_adjacency_sequence_out()  # long time
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.graphs.base.sparse_graph._test_adjacency_sequence_out[1]>", line 1, in <module>
        _test_adjacency_sequence_out()  # long time
      File "sage/graphs/base/sparse_graph.pyx", line 1189, in sage.graphs.base.sparse_graph._test_adjacency_sequence_out (build/cythonized/sage/graphs/base/sparse_graph.c:9302)
        u = randint(low, n - 1)
      File "/home/jonathan/Applications/sage/local/lib/python3.8/site-packages/sage/misc/prandom.py", line 137, in randint
        return _pyrand().randint(a, b)
      File "/home/jonathan/Applications/sage/local/lib/python3.8/site-packages/sage/cpython/_py2_random.py", line 220, in randint
        return self.randrange(a, b+1)
      File "/home/jonathan/Applications/sage/local/lib/python3.8/site-packages/sage/cpython/_py2_random.py", line 195, in randrange
        raise ValueError("empty range for randrange() (%d,%d, %d)" %
    ValueError: empty range for randrange() (0,0, 0)

sage -t --long --random-seed=180924489930967511277954046005685261728 src/sage/graphs/generators/families.py
**********************************************************************
File "src/sage/graphs/generators/families.py", line 1477, in sage.graphs.generators.families.FriendshipGraph
Failed example:
    G.diameter()
Expected:
    2
Got:
    1

CC: @dcoudert

Component: graph theory

Keywords: fuzzing

Author: Jonathan Kliem

Branch/Commit: 50e4c8d

Reviewer: David Coudert

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

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

kliem commented Oct 26, 2021

Branch: public/32772

@kliem
Copy link
Contributor Author

kliem commented Oct 26, 2021

Commit: 50e4c8d

@kliem
Copy link
Contributor Author

kliem commented Oct 26, 2021

New commits:

50e4c8dfix two test failures for graphs

@kliem
Copy link
Contributor Author

kliem commented Oct 26, 2021

Author: Jonathan Kliem

@dcoudert
Copy link
Contributor

Reviewer: David Coudert

@dcoudert
Copy link
Contributor

comment:2

I agree with your changes.

@kliem
Copy link
Contributor Author

kliem commented Oct 26, 2021

comment:3

Thank you.

@vbraun
Copy link
Member

vbraun commented Oct 31, 2021

Changed branch from public/32772 to 50e4c8d

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

3 participants