Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#10431 closed defect (fixed)

cmdline.py doctest failures on fulvia (SunOS)

Reported by: jdemeyer Owned by: mvngu
Priority: blocker Milestone: sage-4.6.1
Component: doctest coverage Keywords: scripts cmdline
Cc: drkirkby, mpatel Merged in: sage-4.6.1.alpha3
Authors: Jeroen Demeyer Reviewers: Dan Drake
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description

On the skynet machine fulvia (SunOS 5.10 i86pc), we get some doctest failures in sage/tests/cmdline.py (added by #10300):

sage -t -long  -force_lib devel/sage/sage/tests/cmdline.py
**********************************************************************
File "/home/buildbot/build/sage/fulvia-1/fulvia_full/build/sage-4.6.1.alpha3/devel/sage-main/sage/tests/cmdline.py", line 158:
    sage: len(out) >= 2   # at least one character + newline
Expected:
    True
Got:
    False
**********************************************************************
File "/home/buildbot/build/sage/fulvia-1/fulvia_full/build/sage-4.6.1.alpha3/devel/sage-main/sage/tests/cmdline.py", line 160:
    sage: err
Expected:
    ''
Got:
    '/home/buildbot/build/sage/fulvia-1/fulvia_full/build/sage-4.6.1.alpha3/local/bin/sage-sage: line 338: readlink: command not found\n'
**********************************************************************
File "/home/buildbot/build/sage/fulvia-1/fulvia_full/build/sage-4.6.1.alpha3/devel/sage-main/sage/tests/cmdline.py", line 173:
    sage: (out, err, ret) = test_executable(["sage", "--startuptime"])
Exception raised:
    Traceback (most recent call last):
      File "/home/buildbot/build/sage/fulvia-1/fulvia_full/build/sage-4.6.1.alpha3/local/bin/ncadoctest.py", line 1231, in run_one_test
        self.run_one_example(test, example, filename, compileflags)
      File "/home/buildbot/build/sage/fulvia-1/fulvia_full/build/sage-4.6.1.alpha3/local/bin/sagedoctest.py", line 38, in run_one_example
        OrigDocTestRunner.run_one_example(self, test, example, filename, compileflags)
      File "/home/buildbot/build/sage/fulvia-1/fulvia_full/build/sage-4.6.1.alpha3/local/bin/ncadoctest.py", line 1172, in run_one_example
        compileflags, 1) in test.globs
      File "<doctest __main__.example_1[54]>", line 1, in <module>
        (out, err, ret) = test_executable(["sage", "--startuptime"])###line 173:
    sage: (out, err, ret) = test_executable(["sage", "--startuptime"])
      File "/home/buildbot/build/sage/fulvia-1/fulvia_full/build/sage-4.6.1.alpha3/local/lib/python/site-packages/sage/tests/cmdline.py", line 366, in test_executable
        raise RuntimeError("timeout in test_executable()")
    RuntimeError: timeout in test_executable()
**********************************************************************
File "/home/buildbot/build/sage/fulvia-1/fulvia_full/build/sage-4.6.1.alpha3/devel/sage-main/sage/tests/cmdline.py", line 174:
    sage: out.find("sage.all: ") >= 0
Expected:
    True
Got:
    False
**********************************************************************

For the first, we need something analogous to the readlink command, for the second we simply need to increase the timeout.

Attachments (2)

10431_fix_readlink.patch (609 bytes) - added by jdemeyer 11 years ago.
SCRIPTS patch
10431_startuptime_timeout.patch (730 bytes) - added by jdemeyer 11 years ago.
SAGELIB patch

Download all attachments as: .zip

Change History (18)

comment:1 follow-up: Changed 11 years ago by jdemeyer

The line

readlink "$SAGE_ROOT/devel/sage" | sed "s/sage-//"

from sage-sage can probably be replaced by:

cd "$SAGE_ROOT/devel/sage" && pwd -P | sed 's|.*/||; s|^sage-||'

which is a lot uglier, but at least it works on Linux, OS X 10.4, SunOS 5.10.

I will prepare a patch.

Changed 11 years ago by jdemeyer

SCRIPTS patch

comment:2 Changed 11 years ago by jdemeyer

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

Changed 11 years ago by jdemeyer

SAGELIB patch

comment:3 Changed 11 years ago by jdemeyer

  • Merged in set to sage-4.6.1.alpha3

comment:4 Changed 11 years ago by drkirkby

Another option would have been to use the readline system call, which is defined by POSIX

http://www.opengroup.org/onlinepubs/009695399/functions/readlink.html

but not the command, where POSIX defines no such command.

dave

comment:5 Changed 11 years ago by drkirkby

I wont have time to look at this today. Not knowing what the command is supposed to do, I'll have to look that up first.

dave

comment:6 Changed 11 years ago by ddrake

  • Reviewers set to Dan Drake
  • Status changed from needs_review to positive_review

Two lines changed; the readlink replacement will definitely work and increasing the startuptime timeout will at least allow us to avoid the problem (we should, of course, just get Sage to start faster...) for now.

comment:7 Changed 11 years ago by drkirkby

Part of the timeout issue on fulvia is the long running background jobs. I'm not sure if the buildbot disables them (there's a README somewhere under /usr/local). But otherwise that machine will be dog slow.

If anyone wants an account on hawk which is running a similar operating system to Solaris 10, but is a much faster machine, I don't mind giving them one.

It takes about 3 seconds to start Sage on my 3.33 GHz Sun. I can't measure the time it takes to start Mathematica - at least not without using some function to measure it with ns grandularity. (OK, not quite ns, but the Mathematica 7 command line starts effectively instantly. The GUI takes about 5 seconds, which is in fact a bit longer than Sage).

comment:8 in reply to: ↑ 1 ; follow-ups: Changed 11 years ago by leif

Replying to jdemeyer:

The line

readlink "$SAGE_ROOT/devel/sage" | sed "s/sage-//"

from sage-sage can probably be replaced by:

cd "$SAGE_ROOT/devel/sage" && pwd -P | sed 's|.*/||; s|^sage-||'

which is a lot uglier, but at least it works on Linux, OS X 10.4, SunOS 5.10.

Just for the record:

SAGE_ROOT/sage also uses realpath if readlink is not available / fails.

Don't know what systems (besides Linux) support that though.

Since we rely on Bash, cd ... && pwd -P ... is of course more "portable" (i.e., generic, and actually POSIX), and likely to be a couple of femtoseconds faster (unless cd takes too long ;-) ).

Note that there is a slight difference: readlink also reads dead links (deleted current Sage branches), while cd of course fails in that case.

comment:9 in reply to: ↑ 8 ; follow-up: Changed 11 years ago by leif

Replying to leif:

Note that there is a slight difference: readlink also reads dead links (deleted current Sage branches), while cd of course fails in that case.

Perhaps keep also the old line, e.g.

    (readlink "$SAGE_ROOT/devel/sage" || 
      (cd "$SAGE_ROOT/devel/sage" && pwd -P | sed 's|.*/||') ) \
    | sed 's|^sage-||'

comment:10 follow-up: Changed 11 years ago by leif

And should we give an appropriate error message (perhaps switching to the main branch) in case the current was deleted?

comment:11 in reply to: ↑ 9 Changed 11 years ago by jdemeyer

Replying to leif:

Perhaps keep also the old line, e.g.

    (readlink "$SAGE_ROOT/devel/sage" || 
      (cd "$SAGE_ROOT/devel/sage" && pwd -P | sed 's|.*/||') ) \
    | sed 's|^sage-||'

Why?

comment:12 in reply to: ↑ 8 Changed 11 years ago by jdemeyer

Replying to leif:

Just for the record:

SAGE_ROOT/sage also uses realpath if readlink is not available / fails.

The Skynet system fulvia doesn't have readlink nor realpath.

comment:13 in reply to: ↑ 10 Changed 11 years ago by jdemeyer

Replying to leif:

And should we give an appropriate error message (perhaps switching to the main branch) in case the current was deleted?

The error message sounds like a good idea, but I wouldn't automatically change branches.

comment:14 Changed 11 years ago by jdemeyer

  • Resolution set to fixed
  • Status changed from positive_review to closed

comment:15 Changed 11 years ago by leif

OT: Does the caret (interpreted as mark-up) in Jeroen's reply to my code example (right before "Why?") also span multiple comments(!) for others?

For me, all text (including the headlines) is typeset in superscript mode from there on.

I'll try to close the tag here:

comment:16 Changed 11 years ago by leif

QED

Note: See TracTickets for help on using tickets.