Skip to content

test_pyrepl.test_history_survive_crash flaky #137179

Description

@colesbury

Bug report

When run on a heavily loaded machine, test_pyrepl.test_history_survive_crash will timeout and spuriously fail.

commands = "spam\nimport time\ntime.sleep(1000)\nquit\n"
try:
self.run_repl(commands, env=env, timeout=3)
except AssertionError:
pass
history = pathlib.Path(hfile.name).read_text()
self.assertIn("2", history)
self.assertIn("exit()", history)
self.assertIn("spam", history)
self.assertIn("import time", history)
self.assertNotIn("sleep", history)
self.assertNotIn("quit", history)

I don't think we should increase the timeout as that will make the test take proportionally longer. I think that the test should check the repl subprocess's output instead of relying on the 3 second timeout.

Linked PRs

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    testsTests in the Lib/test dirtopic-replRelated to the interactive shelltype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions