summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRelease Manager <release@sagemath.org>2018-04-13 16:04:31 +0200
committerVolker Braun <vbraun.name@gmail.com>2018-04-13 16:04:31 +0200
commit9bac572eb4a2351c4bbd47aa30fe8b8b57b65051 (patch)
treefc85888e6323f26643e42ae276c5672c1086e464
parentTrac #25092: sage --gdb does not start due to SIGFPE (diff)
parentadd a more detailed comment (diff)
Trac #25107: Ignored OSErrors in test output on Cygwin
When running the test suite on Cygwin, whether a test passes or fails the test log is full (for each test module of output like): {{{ sage -t --long src/sage/interfaces/gap.py Exception OSError: (2, 'No such file or directory', '/tmp/tmpwVkVtd') in <bound method _TemporaryFileWrapper.__del__ of <closed file '<fdopen>', mode 'w+b' at 0x6f8032f1e40>> ignored [224 tests, 49.25 s] }}} in particular this of course causes tests of the doctest runner itself to fail, and it's also making all the patchbot runs fail. URL: https://trac.sagemath.org/25107 Reported by: embray Ticket author(s): Erik Bray Reviewer(s): Jeroen Demeyer
-rw-r--r--src/sage/doctest/forker.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/sage/doctest/forker.py b/src/sage/doctest/forker.py
index 2fe47d7..48e057f 100644
--- a/src/sage/doctest/forker.py
+++ b/src/sage/doctest/forker.py
@@ -1991,6 +1991,19 @@ class DocTestWorker(multiprocessing.Process):
# Note: This closes the tempfile in the child process, but in the
# parent process self.outtmpfile will not be closed yet, and can
# still be accessed in save_result_output
+ if hasattr(self.outtmpfile, 'delete'):
+ # On some platforms (notably Cygwin) tempfile.TemporaryFile is
+ # actually replaced by tempfile.NamedTemporaryFile with
+ # delete=True for this file
+ # This means that we end up with two NamedTemporaryFile
+ # instances--one on the parent process and one on the worker
+ # process. Since NamedTemporaryFile automatically unlinks the
+ # file when it is closed, this can lead to an unhandled
+ # exception in the parent process if the child process closes
+ # this file first. See https://trac.sagemath.org/ticket/25107#comment:14
+ # for more details.
+ self.outtmpfile.delete = False
+
self.outtmpfile.close()
def start(self):