cschwan / sage-on-gentoo

(Unofficial) Gentoo Overlay for Sage- and Sage-related ebuilds
84 stars 26 forks source link

doctest failures (sage-8.1.beta3) in prefix that do not appear in gentoo #482

Closed strogdon closed 7 years ago

strogdon commented 7 years ago
too many failed tests, not using stored timings
Running doctests with ID 2017-08-31-14-55-07-de242608.
Using --optional=optional,sage
Doctesting 3 files.
sage -t --long usr/lib64/python2.7/site-packages/sage/doctest/sources.py
**********************************************************************
File "usr/lib64/python2.7/site-packages/sage/doctest/sources.py", line 648, in sage.doctest.sources.FileDocTestSource.in_lib
Failed example:
    FDS.in_lib
Expected:
    False
Got:
    True
**********************************************************************
1 item had failures:
   1 of  15 in sage.doctest.sources.FileDocTestSource.in_lib
    [367 tests, 1 failure, 112.49 s]
sage -t --long usr/lib64/python2.7/site-packages/sage/doctest/forker.py
**********************************************************************
File "usr/lib64/python2.7/site-packages/sage/doctest/forker.py", line 2113, in sage.doctest.forker.DocTestTask
Failed example:
    ntests, results = DTT(options=DD)
Expected nothing
Got:
    **********************************************************************
    File "/storage/strogdon/gentoo-rap/usr/lib64/python2.7/site-packages/sage/doctest/sources.py", line 648, in sage.doctest.sources.FileDocTestSource.in_lib
    Failed example:
        FDS.in_lib
    Expected:
        False
    Got:
        True
    **********************************************************************
    1 item had failures:
       1 of  15 in sage.doctest.sources.FileDocTestSource.in_lib
**********************************************************************
1 item had failures:
   1 of  14 in sage.doctest.forker.DocTestTask
    [444 tests, 1 failure, 18.03 s]
sage -t --long usr/lib64/python2.7/site-packages/sage/graphs/graph_generators.py
**********************************************************************
File "usr/lib64/python2.7/site-packages/sage/graphs/graph_generators.py", line 566, in sage.graphs.graph_generators.GraphGenerators
Failed example:
    graphs_list.show_graphs(L) # long time
Expected nothing
Got:
    doctest:warning
      File "/storage/strogdon/gentoo-rap/usr/lib/python-exec/python2.7/sage-runtests", line 98, in <module>
        err = DC.run()
      File "/storage/strogdon/gentoo-rap/usr/lib64/python2.7/site-packages/sage/doctest/control.py", line 1099, in run
        self.run_doctests()
      File "/storage/strogdon/gentoo-rap/usr/lib64/python2.7/site-packages/sage/doctest/control.py", line 824, in run_doctests
        self.dispatcher.dispatch()
      File "/storage/strogdon/gentoo-rap/usr/lib64/python2.7/site-packages/sage/doctest/forker.py", line 1777, in dispatch
        self.parallel_dispatch()
      File "/storage/strogdon/gentoo-rap/usr/lib64/python2.7/site-packages/sage/doctest/forker.py", line 1667, in parallel_dispatch
        w.start()  # This might take some time
      File "/storage/strogdon/gentoo-rap/usr/lib64/python2.7/site-packages/sage/doctest/forker.py", line 1943, in start
        super(DocTestWorker, self).start()
      File "/storage/strogdon/gentoo-rap/usr/lib64/python2.7/multiprocessing/process.py", line 130, in start
        self._popen = Popen(self)
      File "/storage/strogdon/gentoo-rap/usr/lib64/python2.7/multiprocessing/forking.py", line 126, in __init__
        code = process_obj._bootstrap()
      File "/storage/strogdon/gentoo-rap/usr/lib64/python2.7/multiprocessing/process.py", line 258, in _bootstrap
        self.run()
      File "/storage/strogdon/gentoo-rap/usr/lib64/python2.7/site-packages/sage/doctest/forker.py", line 1916, in run
        task(self.options, self.outtmpfile, msgpipe, self.result_queue)
      File "/storage/strogdon/gentoo-rap/usr/lib64/python2.7/site-packages/sage/doctest/forker.py", line 2218, in __call__
        result = runner.run(test)
      File "/storage/strogdon/gentoo-rap/usr/lib64/python2.7/site-packages/sage/doctest/forker.py", line 663, in run
        return self._run(test, compileflags, out)
      File "/storage/strogdon/gentoo-rap/usr/lib64/python2.7/site-packages/sage/doctest/forker.py", line 518, in _run
        self.compile_and_execute(example, compiler, test.globs)
      File "/storage/strogdon/gentoo-rap/usr/lib64/python2.7/site-packages/sage/doctest/forker.py", line 888, in compile_and_execute
        exec(compiled, globs)
      File "<doctest sage.graphs.graph_generators.GraphGenerators[7]>", line 1, in <module>
        graphs_list.show_graphs(L) # long time
      File "/storage/strogdon/gentoo-rap/usr/lib64/python2.7/site-packages/sage/graphs/graph_list.py", line 366, in show_graphs
        to_graphics_array(graph_slice, **kwds).show()
      File "/storage/strogdon/gentoo-rap/usr/lib64/python2.7/site-packages/sage/plot/graphics.py", line 3725, in show
        dm.display_immediately(self, **kwds)
      File "/storage/strogdon/gentoo-rap/usr/lib64/python2.7/site-packages/sage/repl/rich_output/display_manager.py", line 831, in display_immediately
        plain_text, rich_output = self._rich_output_formatter(obj, rich_repr_kwds)
      File "/storage/strogdon/gentoo-rap/usr/lib64/python2.7/site-packages/sage/repl/rich_output/display_manager.py", line 623, in _rich_output_formatter
        rich_output = self._call_rich_repr(obj, rich_repr_kwds)
      File "/storage/strogdon/gentoo-rap/usr/lib64/python2.7/site-packages/sage/repl/rich_output/display_manager.py", line 590, in _call_rich_repr
        RichReprWarning,
    :
    RichReprWarning: Exception in _rich_repr_ while displaying object: No module named Tkinter
    Graphics Array of size 4 x 4
**********************************************************************
File "usr/lib64/python2.7/site-packages/sage/graphs/graph_generators.py", line 575, in sage.graphs.graph_generators.GraphGenerators
Failed example:
    graphs_list.show_graphs(L)              # long time
Expected nothing
Got:
    Graphics Array of size 6 x 4
    Graphics Array of size 3 x 4
**********************************************************************
1 item had failures:
   2 of  33 in sage.graphs.graph_generators.GraphGenerators
    [88 tests, 2 failures, 17.89 s]
----------------------------------------------------------------------
sage -t --long usr/lib64/python2.7/site-packages/sage/doctest/sources.py  # 1 doctest failed
sage -t --long usr/lib64/python2.7/site-packages/sage/doctest/forker.py  # 1 doctest failed
sage -t --long usr/lib64/python2.7/site-packages/sage/graphs/graph_generators.py  # 2 doctests failed
----------------------------------------------------------------------
Total time for all tests: 203.4 seconds
    cpu time: 135.3 seconds
    cumulative wall time: 148.4 seconds

I usually don't have this many differences. The first two failures are obviously related. Relative to the last failure I do have future installed which provides tkinter.

kiwifb commented 7 years ago

Interesting stuff. What are the useflags for python:2.7?

strogdon commented 7 years ago

This is for prefix and are the same on gentoo:

[I] dev-lang/python
     Available versions:  
     (2.7)  [m]2.7.12 2.7.12-r102[1] [m]2.7.13 [m]2.7.13-r100[1]
     (3.4)  [m]3.4.5(3.4/3.4m) [m]3.4.6(3.4/3.4m)
     (3.5)  [m]3.5.3(3.5/3.5m)
     (3.6)  [m]3.6.1-r1(3.6/3.6m)
       {-berkdb build doc examples gdbm hardened ipv6 libressl +ncurses +readline sqlite +ssl +threads tk +wide-unicode wininst +xml ELIBC="uclibc"}
     Installed versions:  2.7.12-r102(2.7)[1](12:48:20 PM 08/30/2017)(gdbm ipv6 ncurses readline sqlite ssl threads wide-unicode xml -berkdb -build -doc -examples -hardened -libressl -tk -wininst ELIBC="-uclibc")
     Homepage:            https://www.python.org/
     Description:         An interpreted, interactive, object-oriented programming language
strogdon commented 7 years ago

the [1] is "sage-on-gentoo" /var/lib/layman/sage-on-gentoo

strogdon commented 7 years ago

Relative to sage -t --long usr/lib64/python2.7/site-packages/sage/graphs/graph_generators.py it appears that a png file is created for viewing but that file is empty.

strogdon commented 7 years ago

The commands

sage: L = list(graphs(5, lambda G: G.size() <= 4))
....: graphs_list.show_graphs(L)
....: 

which fail from the sage prompt do work in the jupyter notebook. Odd.

kiwifb commented 7 years ago

Very odd indeed. I would say something is loaded properly in jupyter and not in sage. Which is very strange considering the connection between jupyter and ipython.

kiwifb commented 7 years ago

The failure in FDS.in_lib should have been around for a while. Can you check if there is a file usr/lib64/python2.7/site-packages/sage/doctest/tests/__init.py__? There shouldn't. I should change some mechanic around that small file.

strogdon commented 7 years ago

Yes, you are correct, the failure in FDS.in_lib has been around since at least 7.6.beta2. I missed that. And there is __init.py__, __init__.pyc and __init__.pyo under sage/doctest/tests/.

strogdon commented 7 years ago

The third failure under https://github.com/cschwan/sage-on-gentoo/issues/482#issue-254462425 was not present in 8.0.beta11. Unfortunately I haven't tested all 8.1.betaX releases.

kiwifb commented 7 years ago

I am just wondering if the __init.py__ file is a left over from previous installs or if the removal mechanic is broken on prefix. Can you check the time stamp?

strogdon commented 7 years ago

time stamp is new. I just finished rebuilding sage and I have

-rw-r--r-- 1 strogdon math   0 Aug 31 23:49 __init__.py
-rw-r--r-- 1 strogdon math 172 Sep  1 00:37 __init__.pyc
-rw-r--r-- 1 strogdon math 172 Sep  1 00:37 __init__.pyo
kiwifb commented 7 years ago

I think I know why. Can you try changing line 440 from

rm -f "${ED}"$(python_get_sitedir)/sage/doctest/tests/__init__.*

to

rm -f "${D}"$(python_get_sitedir)/sage/doctest/tests/__init__.*

I think my mistake is that python_get_sitedir is already prefixed.

kiwifb commented 7 years ago

Actually, it probably shows up in the log during the install phase. Something like "cannot remove file ...".

strogdon commented 7 years ago

Replacing ${ED} with ${D} removed __init__.*. source.py is now OK:

sage -t usr/lib64/python2.7/site-packages/sage/doctest/sources.py
    [366 tests, 1.41 s]
----------------------------------------------------------------------
All tests passed!
----------------------------------------------------------------------

but some new stuff testing forker.py:

sage -t usr/lib64/python2.7/site-packages/sage/doctest/forker.py
**********************************************************************
File "usr/lib64/python2.7/site-packages/sage/doctest/forker.py", line 1123, in sage.doctest.forker.SageDocTestRunner.report_failure
Failed example:
    print(sage0.eval("sdf.init_sage(); DTR.run(DT, clear_globs=False)")) # indirect doctest
Expected:
    **********************************************************************
    Line 1, in doubling
    Failed example:
        2*a
    Expected:
        1
    Got:
        34
    **********************************************************************
    Previously executed commands:
    ...
Got:
    **********************************************************************
    Line 1, in doubling
    Failed example:
        2*a
    Expected:
        1
    Got:
        34
    **********************************************************************
    Previously executed commands:
**********************************************************************
File "usr/lib64/python2.7/site-packages/sage/doctest/forker.py", line 1135, in sage.doctest.forker.SageDocTestRunner.report_failure
Failed example:
    sage0.eval("a")
Expected:
    '...17'
Got:
    ''
**********************************************************************
File "usr/lib64/python2.7/site-packages/sage/doctest/forker.py", line 1137, in sage.doctest.forker.SageDocTestRunner.report_failure
Failed example:
    sage0.eval("quit")
Expected:
    'Returning to doctests...TestResults(failed=1, attempted=2)'
Got:
    '17'
**********************************************************************
1 item had failures:
   3 of  29 in sage.doctest.forker.SageDocTestRunner.report_failure
    [444 tests, 3 failures, 18.37 s]
----------------------------------------------------------------------
sage -t usr/lib64/python2.7/site-packages/sage/doctest/forker.py  # 3 doctests failed
----------------------------------------------------------------------

This is now with ipython-5.4.1 and I suspect that that's the cause.

strogdon commented 7 years ago

Moving doctesting of graph_generators.py to its separate issue.