Opened 5 years ago

Closed 3 years ago

Last modified 3 years ago

#20222 closed defect (fixed)

One-off doctest failures in a fresh install because of matplotlib

Reported by: defeo Owned by:
Priority: major Milestone: sage-8.0
Component: build Keywords:
Cc: jdemeyer, embray, nthiery Merged in:
Authors: Jeroen Demeyer Reviewers: Erik Bray, Julian Rüth
Report Upstream: N/A Work issues:
Branch: 7169df8 (Commits) Commit:
Dependencies: Stopgaps:

Description (last modified by jdemeyer)

When running Sage doctests for the very first time (with an empty DOT_SAGE directory):

sage -t --long src/sage/geometry/fan.py
**********************************************************************
File "src/sage/geometry/fan.py", line 2887, in sage.geometry.fan.?.plot
Failed example:
    fan.plot()
Expected:
    Graphics object consisting of 31 graphics primitives
Got:
    doctest:273: UserWarning: Matplotlib is building the font cache using fc-list. This may take a moment.
    Graphics object consisting of 31 graphics primitives
**********************************************************************
1 item had failures:
   1 of   3 in sage.geometry.fan.?.plot
    [492 tests, 1 failure, 9.60 s]
sage -t --long src/sage/categories/coxeter_groups.py
**********************************************************************
File "src/sage/categories/coxeter_groups.py", line 1681, in sage.categories.coxeter_groups.CoxeterGroups.ElementMethods.bruhat_lower_cov
ers
Failed example:
    P.show()
Expected nothing
Got:
    doctest:273: UserWarning: Matplotlib is building the font cache using fc-list. This may take a moment.
**********************************************************************
1 item had failures:
   1 of  15 in sage.categories.coxeter_groups.CoxeterGroups.ElementMethods.bruhat_lower_covers
    [461 tests, 1 failure, 18.31 s]

Of course, the failures go away when the tests are rerun. Any way we can avoid these failures?

Change History (23)

comment:1 Changed 5 years ago by jdemeyer

  • Cc embray nthiery added

Running tests inside a fresh docker container could be a good way to check for problems like this.

comment:2 Changed 5 years ago by embray

Still don't have automated builds of the sagemath-develop container running yet, but hope to have that sooner or later.

comment:3 Changed 4 years ago by jdemeyer

  • Component changed from doctest framework to build
  • Priority changed from minor to major

comment:4 follow-up: Changed 4 years ago by jdemeyer

Can't we simply ignore these warnings?

comment:5 in reply to: ↑ 4 Changed 4 years ago by defeo

Replying to jdemeyer:

Can't we simply ignore these warnings?

What's the standard way to ignore warnings in doctests, again?

comment:6 follow-up: Changed 4 years ago by embray

I wonder if the initial sage startup shouldn't also take care of this.

comment:7 in reply to: ↑ 6 Changed 4 years ago by jdemeyer

Replying to embray:

I wonder if the initial sage startup shouldn't also take care of this.

That's not really possible because the relevant matplotlib files are user files (inside $DOT_SAGE, which is typically in $HOME), not system files.

comment:8 Changed 4 years ago by embray

I think I see what you're saying--I'm so used at this point to running my own copy of sage that it's warped my viewpoint in ugly ways :)

But isn't there some initial creation of user files in $DOT_SAGE the first time a user runs Sage? That's what I meant.

comment:10 Changed 4 years ago by jdemeyer

  • Branch set to u/jdemeyer/one_off_doctest_failures_in_a_fresh_install

comment:11 Changed 4 years ago by jdemeyer

  • Authors set to Jeroen Demeyer
  • Commit set to e2083fc285507f658ee1babe515118a0208977fd
  • Status changed from new to needs_review

New commits:

e2083fcBuild Matplotlib font cache before running doctests

comment:12 Changed 4 years ago by embray

  • Milestone changed from sage-7.1 to sage-8.0
  • Status changed from needs_review to positive_review

Huh, I thought this was already fixed. I haven't run into it in a while.

comment:13 Changed 4 years ago by jdemeyer

  • Reviewers set to Erik Bray

comment:14 Changed 4 years ago by vbraun

  • Status changed from positive_review to needs_work
sage -t --long --warn-long 81.6 src/sage/tests/startup.py
**********************************************************************
File "src/sage/tests/startup.py", line 6, in sage.tests.startup
Failed example:
    'numpy' in sys.modules
Expected:
    False
Got:
    True
**********************************************************************
File "src/sage/tests/startup.py", line 8, in sage.tests.startup
Failed example:
    'pyparsing' in sys.modules
Expected:
    False
Got:
    True
**********************************************************************
1 item had failures:
   2 of   7 in sage.tests.startup
    [6 tests, 2 failures, 1.47 s]

comment:15 Changed 4 years ago by jdemeyer

  • Summary changed from One-off doctest failures in a fresh install to One-off doctest failures in a fresh install because of matplotlib

comment:16 Changed 4 years ago by git

  • Commit changed from e2083fc285507f658ee1babe515118a0208977fd to dd1dfe4b8b729499c09ef0bb301e13d25c74297f

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

dd1dfe4Build Matplotlib font cache before running doctests

comment:17 Changed 4 years ago by git

  • Commit changed from dd1dfe4b8b729499c09ef0bb301e13d25c74297f to 59e671e868764eba3a4bbd62977460f069ce99b2

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

59e671eBuild Matplotlib font cache before running doctests

comment:18 Changed 4 years ago by jdemeyer

  • Description modified (diff)
  • Status changed from needs_work to needs_review

New version which imports matplotlib in a forked child process.

comment:19 Changed 3 years ago by git

  • Commit changed from 59e671e868764eba3a4bbd62977460f069ce99b2 to 7169df8578eeb59a0de4b649a632f3db2b7c0a4a

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

7169df8Build Matplotlib font cache before running doctests

comment:20 Changed 3 years ago by saraedum

  • Reviewers changed from Erik Bray to Erik Bray, Julian Rüth
  • Status changed from needs_review to positive_review

comment:21 Changed 3 years ago by vbraun

  • Branch changed from u/jdemeyer/one_off_doctest_failures_in_a_fresh_install to 7169df8578eeb59a0de4b649a632f3db2b7c0a4a
  • Resolution set to fixed
  • Status changed from positive_review to closed

comment:22 Changed 3 years ago by jhpalmieri

  • Commit 7169df8578eeb59a0de4b649a632f3db2b7c0a4a deleted

I'm seeing these failures again in 8.3.beta1.

comment:23 Changed 3 years ago by jhpalmieri

See #25375 for a followup ticket.

Note: See TracTickets for help on using tickets.