Made doctest deterministic in set.py.
Add upstream PR 63661
Merge branch 'public/singleton_class-15247' of trac.sagemath.org:sage into public/misc/random_failure_sets-17409

Conflicts:
	src/sage/sets/set.py
Trac #17355: Random failure in qsieve

{{{
sage -t --long src/sage/interfaces/qsieve.py
**********************************************************************
File "src/sage/interfaces/qsieve.py", line 260, in
sage.interfaces.qsieve.qsieve_nonblock.quit
Failed example:
    qs.quit()
Exception raised:
    Traceback (most recent call last):
      File "/mnt/disk/home/buildslave-
sage/slave/sage_git/build/local/lib/python2.7/site-
packages/sage/doctest/forker.py", line 488, in _run
        self.compile_and_execute(example, compiler, test.globs)
      File "/mnt/disk/home/buildslave-
sage/slave/sage_git/build/local/lib/python2.7/site-
packages/sage/doctest/forker.py", line 851, in compile_and_execute
        exec(compiled, globs)
      File "<doctest sage.interfaces.qsieve.qsieve_nonblock.quit[3]>",
line 1, in <module>
        qs.quit()
      File "/mnt/disk/home/buildslave-
sage/slave/sage_git/build/local/lib/python2.7/site-
packages/sage/interfaces/qsieve.py", line 265, in quit
        os.killpg(int(pid),9)
    OSError: [Errno 3] No such process
**********************************************************************
File "src/sage/interfaces/qsieve.py", line 261, in
sage.interfaces.qsieve.qsieve_nonblock.quit
Failed example:
    qs
Expected:
    Factorization was terminated early.
Got:
    Proper factors so far: []
**********************************************************************
}}}

URL: http://trac.sagemath.org/17355
Reported by: vbraun
Ticket author(s): Volker Braun
Reviewer(s): Frédéric Chapoton
Trac #17415: Random failure in ell_rational_field.py

Garbage collection coming at the wrong time can cause
{{{
File "src/sage/schemes/elliptic_curves/ell_rational_field.py", line 590,
in sage.schemes.elliptic_curves.ell_rational_field.EllipticCurve_rationa
l_field.pari_curve
Failed example:
    _ = E.__dict__.pop('_pari_curve')  # clear cached data
Exception raised:
    Traceback (most recent call last):
      File "/usr/local/src/sage-config/local/lib/python2.7/site-
packages/sage/doctest/forker.py", line 488, in _run
        self.compile_and_execute(example, compiler, test.globs)
      File "/usr/local/src/sage-config/local/lib/python2.7/site-
packages/sage/doctest/forker.py", line 851, in compile_and_execute
        exec(compiled, globs)
      File "<doctest sage.schemes.elliptic_curves.ell_rational_field.Ell
ipticCurve_rational_field.pari_curve[9]>", line 1, in <module>
        _ = E.__dict__.pop('_pari_curve')  # clear cached data
    KeyError: '_pari_curve'
}}}

URL: http://trac.sagemath.org/17415
Reported by: jdemeyer
Ticket author(s): Peter Bruin
Reviewer(s): Volker Braun
Trac #17410: unambiguously doctest longest_path()

A doctest or longest_path() is ambiguous :
{{{
sage: l = [(0, 1), (0, 3), (2, 0)]
sage: G = DiGraph(l)
sage: G.longest_path().edges()
[(0, 3, None), (2, 0, None)]
}}}

Starting with sage 6.5beta1, sage gives the equally valid answer
{{{
[(0, 1, None), (2, 0, None)]
}}}
but this is detected as a failure by sage ptestlong.

So let's use a problem with a unique solution.

URL: http://trac.sagemath.org/17410
Reported by: charpent
Ticket author(s): Emmanuel Charpentier
Reviewer(s): Vincent Delecroix
Trac #17381: Remove outdated and currently unused mercurial package

Our Version of mercurial is 2.2.2 (more than 2 years old) while upstream
is at 3.2.1. We are not using it in our workflow for a while and it is
unlikely we will use it soon.

The aim of this ticket is to get rid of this package.

URL: http://trac.sagemath.org/17381
Reported by: tmonteil
Ticket author(s): Thierry Monteil
Reviewer(s): Frédéric Chapoton, André Apitzsch
Trac #17208: gsl testsuite failure on OSX 10.10

Full log attached, testsuite errors start with:
{{{
make  check-TESTS
FAIL: gsl_sf_mathieu_se(1, 5.0, M_PI_2, &r) [2613]
  expected: 1.3374338870223450e+00
  obtained: 1.0000000000000000e+00 +/- 4.4408920985006262e-16
(rel=4.44089e-16)
  fracdiff: 1.4436082615889587e-01
 tolerance: 9.9999999999999995e-07
  value/expected not consistent within reported error
  value not within tolerance of expected value
  1.000000000000000000e+00  4.440892098500626162e-16
}}}
This is with our own gcc, it works with clang.

Upstream bug reports:
* http://lists.gnu.org/archive/html/bug-gsl/2014-10/msg00007.html
* https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63661

URL: http://trac.sagemath.org/17208
Reported by: vbraun
Ticket author(s): Volker Braun
Reviewer(s): John Palmieri
Trac #17409: Random failure in sets/set.py

{{{
sage -t --long src/sage/sets/set.py
**********************************************************************
File "src/sage/sets/set.py", line 102, in sage.sets.set.Set
Failed example:
    sorted(Set([Sequence([3,1], immutable=True), 5, QQ,
Partition([3,1,1])]))
Expected:
    [Rational Field, [3, 1], [3, 1, 1], 5]
Got:
    [5, Rational Field, [3, 1], [3, 1, 1]]
**********************************************************************
}}}

URL: http://trac.sagemath.org/17409
Reported by: vbraun
Ticket author(s): Travis Scrimshaw
Reviewer(s): Volker Braun