Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-132912: Account for race in test_keyboard_interrupt in test_remote_pdb#132929

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
pablogsal merged 2 commits intopython:mainfrompablogsal:gh-132912
Apr 25, 2025

Conversation

pablogsal
Copy link
Member

@pablogsalpablogsal commentedApr 25, 2025
edited by bedevere-appbot
Loading

@pablogsal
Copy link
MemberAuthor

There was a very rare race here as the test can be interrupted just when we are leaving the socket synchronization function before we go back to the main function

@pablogsal
Copy link
MemberAuthor

Tested locally as@vstinner did and couldn't find anything for 2000 iterations:

OK0:02:08 load avg: 38.40 [2021] test_remote_pdb passedtest_breakpoints (test.test_remote_pdb.PdbConnectTestCase.test_breakpoints)Test setting and hitting breakpoints. ... oktest_connect_and_basic_commands (test.test_remote_pdb.PdbConnectTestCase.test_connect_and_basic_commands)Test connecting to a remote debugger and sending basic commands. ... oktest_handle_eof (test.test_remote_pdb.PdbConnectTestCase.test_handle_eof)Test that EOF signal properly exits the debugger. ... oktest_help_system (test.test_remote_pdb.PdbConnectTestCase.test_help_system)Test that the help system properly sends help text to the client. ... oktest_keyboard_interrupt (test.test_remote_pdb.PdbConnectTestCase.test_keyboard_interrupt)Test that sending keyboard interrupt breaks into pdb. ... oktest_multi_line_commands (test.test_remote_pdb.PdbConnectTestCase.test_multi_line_commands)Test that multi-line commands work properly over remote connection. ... oktest_protocol_version (test.test_remote_pdb.PdbConnectTestCase.test_protocol_version)Test that incompatible protocol versions are properly detected. ... oktest_cmdloop (test.test_remote_pdb.RemotePdbTestCase.test_cmdloop)Test the command loop with various commands. ... oktest_completion (test.test_remote_pdb.RemotePdbTestCase.test_completion)Test handling completion requests. ... oktest_detach (test.test_remote_pdb.RemotePdbTestCase.test_detach)Test the detach method. ... oktest_do_help (test.test_remote_pdb.RemotePdbTestCase.test_do_help)Test that do_help sends the help message. ... oktest_interact_mode (test.test_remote_pdb.RemotePdbTestCase.test_interact_mode)Test interaction mode setup and execution. ... testoktest_message_and_error (test.test_remote_pdb.RemotePdbTestCase.test_message_and_error)Test message and error methods send correct JSON. ... oktest_read_command (test.test_remote_pdb.RemotePdbTestCase.test_read_command)Test reading commands from the socket. ... oktest_read_command_EOF (test.test_remote_pdb.RemotePdbTestCase.test_read_command_EOF)Test reading EOF command. ... oktest_registering_commands (test.test_remote_pdb.RemotePdbTestCase.test_registering_commands)Test registering breakpoint commands. ... ok----------------------------------------------------------------------Ran 16 tests in 4.128s

@pablogsal
Copy link
MemberAuthor

CC@godlygeek

@vstinner
Copy link
Member

Somehow related: test_remote_pdb can still fail on a heavy loaded machine because of its hardcoded timeout of 5 seconds. I wrote#132939 to fix this issue.

Copy link
Member

@vstinnervstinner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

LGTM. I cannot make it fail, it looks way more reliable.

I tested on a Linux laptop with 12 logical CPUs:

  • 4 terminals running:./python -m test test_remote_pdb -m test_keyboard_interrupt -v --timeout=15 --forever
  • 1 terminal running:./python -m test test_remote_pdb -m test_keyboard_interrupt -W --timeout=60 --forever -j150

I ran my test for 5 minutes. The system load was around 162.

@pablogsal
Copy link
MemberAuthor

Fantastic. Thanks for the help@vstinner!

@pablogsalpablogsal merged commit6cbeb6a intopython:mainApr 25, 2025
42 checks passed
@pablogsalpablogsal deleted the gh-132912 branchApril 25, 2025 13:46
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@vstinnervstinnervstinner approved these changes

@gaogaotiantiangaogaotiantianAwaiting requested review from gaogaotiantiangaogaotiantian is a code owner

Assignees
No one assigned
Labels
skip newstestsTests in the Lib/test dir
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@pablogsal@vstinner

[8]ページ先頭

©2009-2025 Movatter.jp