Skip to content

Commit a29d22e

Browse files
committed
Add note on a doctest that randomly behaves
1 parent 443b754 commit a29d22e

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/sage/doctest/test.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,17 +251,24 @@
251251
252252
Even though the doctester master process has exited, the child process
253253
is still alive, but it should be killed automatically
254-
after the `die_timeout` given above (10 seconds)::
254+
after the ``die_timeout`` given above (10 seconds)::
255255
256256
sage: pid = int(open(F).read()) # long time
257257
sage: time.sleep(2) # long time
258258
sage: os.kill(pid, signal.SIGQUIT) # long time; 2 seconds passed => still alive
259259
sage: time.sleep(8) # long time
260-
sage: os.kill(pid, signal.SIGQUIT) # long time; 10 seconds passed => dead
260+
sage: os.kill(pid, signal.SIGQUIT) # long time; 10 seconds passed => dead # random
261261
Traceback (most recent call last):
262262
...
263263
ProcessLookupError: ...
264264
265+
If the child process is dead and removed, the last output should be as above.
266+
However, the child process interrupted its parent process (see
267+
``"interrupt_diehard.rst"``), and became an orphan process. Depending on the
268+
system, an orphan process may eventually become a zombie process instead of
269+
being removed, and then the last output would just be a blank. Hence the ``#
270+
random`` tag.
271+
265272
Test a doctest failing with ``abort()``::
266273
267274
sage: subprocess.call(["sage", "-t", "--warn-long", "0", # long time

0 commit comments

Comments
 (0)