Skip to content

Commit

Permalink
Trac #28287: alarm test failure in CombinatorialPolyhedron.f_vector
Browse files Browse the repository at this point in the history
Ever since the merging of #26887 I get this one test failure:

{{{
sage -t --long --warn-long 157.3
src/sage/geometry/polyhedron/combinatorial_polyhedron/base.pyx
**********************************************************************
File "src/sage/geometry/polyhedron/combinatorial_polyhedron/base.pyx",
line 1132, in sage.geometry.polyhedron.combinatorial_polyhedron.base.Com
binatorialPolyhedron.f_vector
Failed example:
    try:
        alarm(0.5)
        C.f_vector()
    except:
        print("alarm!")
Expected:
    alarm!
Got:
    (1,
     25,
     300,
     2300,
     12650,
     53130,
     177100,
     480700,
     1081575,
     2042975,
     3268760,
     4457400,
     5200300,
     5200300,
     4457400,
     3268760,
     2042975,
     1081575,
     480700,
     177100,
     53130,
     12650,
     2300,
     300,
     25,
     1)
**********************************************************************
1 item had failures:
   1 of  12 in sage.geometry.polyhedron.combinatorial_polyhedron.base.Co
mbinatorialPolyhedron.f_vector
    [324 tests, 1 failure, 6.49 s]
}}}

It's a minor issue, but I mark the ticket priority as "critical" as this
is likely to affect others as well, and constitutes a regression.
There's no way to guarantee that 0.5 seconds, or any amount of time
really, is short enough to trigger the alarm as soon as the test
requires (though if nothing else it should be a shorter time).  I did
check, to be certain, that lowering the alarm time in this test does
cause it to pass for me. But that's no guarantee it won't still fail on
an even faster machine.

Although, if as [https://trac.sagemath.org/ticket/26887#comment:184 this
comment] states, there is no explicit reason for these tests, I would
just remove them.

URL: https://trac.sagemath.org/28287
Reported by: embray
Ticket author(s): Jonathan Kliem
Reviewer(s): Erik Bray
  • Loading branch information
Release Manager committed Aug 3, 2019
2 parents ac8cf16 + e62f499 commit 9a0cb42
Showing 1 changed file with 0 additions and 90 deletions.
90 changes: 0 additions & 90 deletions src/sage/geometry/polyhedron/combinatorial_polyhedron/base.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -594,26 +594,6 @@ cdef class CombinatorialPolyhedron(SageObject):
sage: P = Polyhedron(rays=[[1,0,0],[0,1,0],[0,0,1],[0,0,-1]])
sage: CombinatorialPolyhedron(P).dimension()
3
TESTS::
sage: from itertools import combinations
sage: N = combinations(range(1200), 1199)
sage: C = CombinatorialPolyhedron(N)
sage: try:
....: alarm(0.1)
....: C.dimension()
....: except:
....: print("alarm!")
....:
alarm!
sage: try:
....: alarm(0.1)
....: C.f_vector()
....: except:
....: print("alarm!")
....:
alarm!
"""
if self._dimension == -2:
# Dimension not computed yet.
Expand Down Expand Up @@ -909,21 +889,6 @@ cdef class CombinatorialPolyhedron(SageObject):
('b', 'c'),
('a', 'c'),
('a', 'b'))
TESTS::
sage: from itertools import combinations
sage: N = combinations(range(200),199)
sage: C = CombinatorialPolyhedron(N)
sage: try:
....: alarm(0.1)
....: C.edges()
....: except:
....: print("alarm!")
....:
alarm!
sage: len(C.edges())
19900
"""
cdef size_t len_edge_list = self._length_edges_list
if self._edges is NULL:
Expand Down Expand Up @@ -1061,21 +1026,6 @@ cdef class CombinatorialPolyhedron(SageObject):
sage: it = C.face_iter(0)
sage: for face in it: face.Hrepr()
(An inequality (1, 0) x + 0 >= 0, An equation (0, 1) x + 0 == 0)
TESTS::
sage: from itertools import combinations
sage: N = combinations(range(200),199)
sage: C = CombinatorialPolyhedron(N)
sage: try:
....: alarm(0.1)
....: C.ridges()
....: except:
....: print("alarm!")
....:
alarm!
sage: len(C.ridges())
19900
"""
cdef size_t len_ridge_list = self._length_edges_list
if self._ridges is NULL:
Expand Down Expand Up @@ -1167,46 +1117,6 @@ cdef class CombinatorialPolyhedron(SageObject):
sage: C = CombinatorialPolyhedron(P)
sage: C.f_vector()
(1, 10, 45, 120, 185, 150, 50, 1)
TESTS::
sage: from itertools import combinations
sage: N = combinations(range(25),24)
sage: C = CombinatorialPolyhedron(N)
sage: try:
....: alarm(0.5)
....: C.f_vector()
....: except:
....: print("alarm!")
....:
alarm!
sage: C.f_vector() # long time
(1,
25,
300,
2300,
12650,
53130,
177100,
480700,
1081575,
2042975,
3268760,
4457400,
5200300,
5200300,
4457400,
3268760,
2042975,
1081575,
480700,
177100,
53130,
12650,
2300,
300,
25,
1)
"""
if not self._f_vector:
self._compute_f_vector()
Expand Down

0 comments on commit 9a0cb42

Please sign in to comment.