Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a note on a doctest that randomly behaves #35751

Merged
merged 1 commit into from
Jun 21, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions src/sage/doctest/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,17 +251,24 @@

Even though the doctester master process has exited, the child process
is still alive, but it should be killed automatically
after the `die_timeout` given above (10 seconds)::
after the ``die_timeout`` given above (10 seconds)::

sage: pid = int(open(F).read()) # long time
sage: time.sleep(2) # long time
sage: os.kill(pid, signal.SIGQUIT) # long time; 2 seconds passed => still alive
sage: time.sleep(8) # long time
sage: os.kill(pid, signal.SIGQUIT) # long time; 10 seconds passed => dead
sage: os.kill(pid, signal.SIGQUIT) # long time; 10 seconds passed => dead # random
Traceback (most recent call last):
...
ProcessLookupError: ...

If the child process is dead and removed, the last output should be as above.
However, the child process interrupted its parent process (see
``"interrupt_diehard.rst"``), and became an orphan process. Depending on the
system, an orphan process may eventually become a zombie process instead of
being removed, and then the last output would just be a blank. Hence the ``#
random`` tag.

Test a doctest failing with ``abort()``::

sage: subprocess.call(["sage", "-t", "--warn-long", "0", # long time
Expand Down