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

test_pyrepl: test_inspect_keeps_globals_from_inspected_* are very flaky #121973

Closed
mgorny opened this issue Jul 18, 2024 · 0 comments
Closed

test_pyrepl: test_inspect_keeps_globals_from_inspected_* are very flaky #121973

mgorny opened this issue Jul 18, 2024 · 0 comments
Labels
tests Tests in the Lib/test dir topic-repl Related to the interactive shell type-bug An unexpected behavior, bug, or error

Comments

@mgorny
Copy link
Contributor

mgorny commented Jul 18, 2024

Bug report

Bug description:

When running the test suite on Gentoo Linux amd64 (with all CPUs busy), these tests are failing frequently:

$ LD_LIBRARY_PATH=. ./python -u -W default -bb -E -m test --fast-ci --timeout= --dont-add-python-opts test_pyrepl
Using random seed: 1056915174
0:00:00 load avg: 14.22 Run 1 test in parallel using 1 worker process (timeout: 10 min, worker timeout: 15 min)
0:00:01 load avg: 14.21 [1/1/1] test_pyrepl failed (3 failures)
test_empty (test.test_pyrepl.test_input.KeymapTranslatorTests.test_empty) ... ok
test_push_character_key (test.test_pyrepl.test_input.KeymapTranslatorTests.test_push_character_key) ... ok
test_push_character_key_with_stack (test.test_pyrepl.test_input.KeymapTranslatorTests.test_push_character_key_with_stack) ... ok
test_push_invalid_key (test.test_pyrepl.test_input.KeymapTranslatorTests.test_push_invalid_key) ... ok
test_push_invalid_key_with_stack (test.test_pyrepl.test_input.KeymapTranslatorTests.test_push_invalid_key_with_stack) ... ok
test_push_invalid_key_with_unicode_category (test.test_pyrepl.test_input.KeymapTranslatorTests.test_push_invalid_key_with_unicode_category) ... ok
test_push_multiple_keys (test.test_pyrepl.test_input.KeymapTranslatorTests.test_push_multiple_keys) ... ok
test_push_single_key (test.test_pyrepl.test_input.KeymapTranslatorTests.test_push_single_key) ... ok
test_push_transition_key (test.test_pyrepl.test_input.KeymapTranslatorTests.test_push_transition_key) ... ok
test_push_transition_key_interrupted (test.test_pyrepl.test_input.KeymapTranslatorTests.test_push_transition_key_interrupted) ... ok
test_empty_line (test.test_pyrepl.test_interact.TestMoreLines.test_empty_line) ... ok
test_incomplete_statement (test.test_pyrepl.test_interact.TestMoreLines.test_incomplete_statement) ... ok
test_invalid_syntax_single_line (test.test_pyrepl.test_interact.TestMoreLines.test_invalid_syntax_single_line) ... ok
test_multiline_single_assignment (test.test_pyrepl.test_interact.TestMoreLines.test_multiline_single_assignment) ... ok
test_multiline_single_block (test.test_pyrepl.test_interact.TestMoreLines.test_multiline_single_block) ... ok
test_multiple_blocks (test.test_pyrepl.test_interact.TestMoreLines.test_multiple_blocks) ... ok
test_multiple_blocks_empty_newline (test.test_pyrepl.test_interact.TestMoreLines.test_multiple_blocks_empty_newline) ... ok
test_multiple_blocks_indented_newline (test.test_pyrepl.test_interact.TestMoreLines.test_multiple_blocks_indented_newline) ... ok
test_multiple_statements (test.test_pyrepl.test_interact.TestMoreLines.test_multiple_statements) ... ok
test_multiple_statements_single_line (test.test_pyrepl.test_interact.TestMoreLines.test_multiple_statements_single_line) ... ok
test_valid_single_statement (test.test_pyrepl.test_interact.TestMoreLines.test_valid_single_statement) ... ok
test_empty (test.test_pyrepl.test_interact.TestSimpleInteract.test_empty) ... ok
test_multiple_statements (test.test_pyrepl.test_interact.TestSimpleInteract.test_multiple_statements) ... ok
test_multiple_statements_output (test.test_pyrepl.test_interact.TestSimpleInteract.test_multiple_statements_output) ... ok
test_no_active_future (test.test_pyrepl.test_interact.TestSimpleInteract.test_no_active_future) ... ok
test_runsource_compiles_and_runs_code (test.test_pyrepl.test_interact.TestSimpleInteract.test_runsource_compiles_and_runs_code) ... ok
test_runsource_returns_false_for_failed_compilation (test.test_pyrepl.test_interact.TestSimpleInteract.test_runsource_returns_false_for_failed_compilation) ... ok
test_runsource_returns_false_for_successful_compilation (test.test_pyrepl.test_interact.TestSimpleInteract.test_runsource_returns_false_for_successful_compilation) ... ok
test_runsource_shows_syntax_error_for_failed_compilation (test.test_pyrepl.test_interact.TestSimpleInteract.test_runsource_shows_syntax_error_for_failed_compilation) ... ok
test_clashing_definitions (test.test_pyrepl.test_keymap.TestCompileKeymap.test_clashing_definitions) ... ok
test_empty_keymap (test.test_pyrepl.test_keymap.TestCompileKeymap.test_empty_keymap) ... ok
test_empty_value (test.test_pyrepl.test_keymap.TestCompileKeymap.test_empty_value) ... ok
test_multiple_empty_values (test.test_pyrepl.test_keymap.TestCompileKeymap.test_multiple_empty_values) ... ok
test_multiple_keymaps (test.test_pyrepl.test_keymap.TestCompileKeymap.test_multiple_keymaps) ... ok
test_nested_keymap (test.test_pyrepl.test_keymap.TestCompileKeymap.test_nested_keymap) ... ok
test_nested_multiple_keymaps (test.test_pyrepl.test_keymap.TestCompileKeymap.test_nested_multiple_keymaps) ... ok
test_non_bytes_key (test.test_pyrepl.test_keymap.TestCompileKeymap.test_non_bytes_key) ... ok
test_single_keymap (test.test_pyrepl.test_keymap.TestCompileKeymap.test_single_keymap) ... ok
test_combinations (test.test_pyrepl.test_keymap.TestParseKeys.test_combinations) ... ok
test_control_sequences (test.test_pyrepl.test_keymap.TestParseKeys.test_control_sequences)
Ensure that supported control sequences are parsed successfully. ... ok
test_escape_sequences (test.test_pyrepl.test_keymap.TestParseKeys.test_escape_sequences)
Ensure that escaping sequences are parsed to their corresponding mapping. ... ok
test_index_errors (test.test_pyrepl.test_keymap.TestParseKeys.test_index_errors) ... ok
test_keynames (test.test_pyrepl.test_keymap.TestParseKeys.test_keynames)
Ensure that keynames are parsed to their corresponding mapping. ... ok
test_keyspec_errors (test.test_pyrepl.test_keymap.TestParseKeys.test_keyspec_errors) ... ok
test_meta_sequences (test.test_pyrepl.test_keymap.TestParseKeys.test_meta_sequences) ... ok
test_single_character (test.test_pyrepl.test_keymap.TestParseKeys.test_single_character)
Ensure that single ascii characters or single digits are parsed as single characters. ... ok
test_cursor_position_after_wrap_and_move_up (test.test_pyrepl.test_pyrepl.TestCursorPosition.test_cursor_position_after_wrap_and_move_up) ... ok
test_cursor_position_double_width_character (test.test_pyrepl.test_pyrepl.TestCursorPosition.test_cursor_position_double_width_character) ... ok
test_cursor_position_double_width_character_move_left (test.test_pyrepl.test_pyrepl.TestCursorPosition.test_cursor_position_double_width_character_move_left) ... ok
test_cursor_position_double_width_character_move_left_right (test.test_pyrepl.test_pyrepl.TestCursorPosition.test_cursor_position_double_width_character_move_left_right) ... ok
test_cursor_position_double_width_characters_move_up (test.test_pyrepl.test_pyrepl.TestCursorPosition.test_cursor_position_double_width_characters_move_up) ... ok
test_cursor_position_double_width_characters_move_up_down (test.test_pyrepl.test_pyrepl.TestCursorPosition.test_cursor_position_double_width_characters_move_up_down) ... ok
test_cursor_position_move_down_to_eol (test.test_pyrepl.test_pyrepl.TestCursorPosition.test_cursor_position_move_down_to_eol) ... ok
test_cursor_position_move_up_to_eol (test.test_pyrepl.test_pyrepl.TestCursorPosition.test_cursor_position_move_up_to_eol) ... ok
test_cursor_position_multiple_double_width_characters_move_left (test.test_pyrepl.test_pyrepl.TestCursorPosition.test_cursor_position_multiple_double_width_characters_move_left) ... ok
test_cursor_position_multiple_mixed_lines_move_up (test.test_pyrepl.test_pyrepl.TestCursorPosition.test_cursor_position_multiple_mixed_lines_move_up) ... ok
test_cursor_position_simple_character (test.test_pyrepl.test_pyrepl.TestCursorPosition.test_cursor_position_simple_character) ... ok
test_down_arrow_end_of_input (test.test_pyrepl.test_pyrepl.TestCursorPosition.test_down_arrow_end_of_input) ... ok
test_left_arrow_simple (test.test_pyrepl.test_pyrepl.TestCursorPosition.test_left_arrow_simple) ... ok
test_right_arrow_end_of_line (test.test_pyrepl.test_pyrepl.TestCursorPosition.test_right_arrow_end_of_line) ... ok
test_up_arrow_simple (test.test_pyrepl.test_pyrepl.TestCursorPosition.test_up_arrow_simple) ... ok
test_dumb_terminal_exits_cleanly (test.test_pyrepl.test_pyrepl.TestMain.test_dumb_terminal_exits_cleanly) ... ok
test_exposed_globals_in_repl (test.test_pyrepl.test_pyrepl.TestMain.test_exposed_globals_in_repl) ... ok
test_inspect_keeps_globals_from_inspected_file (test.test_pyrepl.test_pyrepl.TestMain.test_inspect_keeps_globals_from_inspected_file) ... 
  test_inspect_keeps_globals_from_inspected_file (test.test_pyrepl.test_pyrepl.TestMain.test_inspect_keeps_globals_from_inspected_file) (var='FOO', expected='42') ... FAIL
test_inspect_keeps_globals_from_inspected_module (test.test_pyrepl.test_pyrepl.TestMain.test_inspect_keeps_globals_from_inspected_module) ... 
  test_inspect_keeps_globals_from_inspected_module (test.test_pyrepl.test_pyrepl.TestMain.test_inspect_keeps_globals_from_inspected_module) (var='__package__', expected="'blue'") ... FAIL
  test_inspect_keeps_globals_from_inspected_module (test.test_pyrepl.test_pyrepl.TestMain.test_inspect_keeps_globals_from_inspected_module) (var='__file__', expected=re.compile("^'.*calx.py'$")) ... FAIL
test_not_wiping_history_file (test.test_pyrepl.test_pyrepl.TestMain.test_not_wiping_history_file) ... ok
test_python_basic_repl (test.test_pyrepl.test_pyrepl.TestMain.test_python_basic_repl) ... ok
test_bracketed_paste (test.test_pyrepl.test_pyrepl.TestPasteEvent.test_bracketed_paste)
Test that bracketed paste using  and  works. ... ok
test_bracketed_paste_single_line (test.test_pyrepl.test_pyrepl.TestPasteEvent.test_bracketed_paste_single_line) ... ok
test_paste (test.test_pyrepl.test_pyrepl.TestPasteEvent.test_paste) ... ok
test_paste_mid_newlines (test.test_pyrepl.test_pyrepl.TestPasteEvent.test_paste_mid_newlines) ... ok
test_paste_mid_newlines_not_in_paste_mode (test.test_pyrepl.test_pyrepl.TestPasteEvent.test_paste_mid_newlines_not_in_paste_mode) ... ok
test_paste_not_in_paste_mode (test.test_pyrepl.test_pyrepl.TestPasteEvent.test_paste_not_in_paste_mode) ... ok
test_auto_indent_continuation (test.test_pyrepl.test_pyrepl.TestPyReplAutoindent.test_auto_indent_continuation) ... ok
test_auto_indent_default (test.test_pyrepl.test_pyrepl.TestPyReplAutoindent.test_auto_indent_default) ... ok
test_auto_indent_ignore_comments (test.test_pyrepl.test_pyrepl.TestPyReplAutoindent.test_auto_indent_ignore_comments) ... ok
test_auto_indent_multiline (test.test_pyrepl.test_pyrepl.TestPyReplAutoindent.test_auto_indent_multiline) ... ok
test_auto_indent_prev_block (test.test_pyrepl.test_pyrepl.TestPyReplAutoindent.test_auto_indent_prev_block) ... ok
test_auto_indent_with_comment (test.test_pyrepl.test_pyrepl.TestPyReplAutoindent.test_auto_indent_with_comment) ... ok
test_completion_with_many_options (test.test_pyrepl.test_pyrepl.TestPyReplCompleter.test_completion_with_many_options) ... ok
test_completion_with_warnings (test.test_pyrepl.test_pyrepl.TestPyReplCompleter.test_completion_with_warnings) ... ok
test_empty_namespace_completion (test.test_pyrepl.test_pyrepl.TestPyReplCompleter.test_empty_namespace_completion) ... ok
test_global_namespace_completion (test.test_pyrepl.test_pyrepl.TestPyReplCompleter.test_global_namespace_completion) ... ok
test_simple_completion (test.test_pyrepl.test_pyrepl.TestPyReplCompleter.test_simple_completion) ... ok
test_updown_arrow_with_completion_menu (test.test_pyrepl.test_pyrepl.TestPyReplCompleter.test_updown_arrow_with_completion_menu)
Up arrow in the middle of unfinished tab completion when the menu is displayed ... ok
test_basic (test.test_pyrepl.test_pyrepl.TestPyReplOutput.test_basic) ... ok
test_control_character (test.test_pyrepl.test_pyrepl.TestPyReplOutput.test_control_character) ... ok
test_history_navigation_with_down_arrow (test.test_pyrepl.test_pyrepl.TestPyReplOutput.test_history_navigation_with_down_arrow) ... ok
test_history_navigation_with_up_arrow (test.test_pyrepl.test_pyrepl.TestPyReplOutput.test_history_navigation_with_up_arrow) ... ok
test_history_search (test.test_pyrepl.test_pyrepl.TestPyReplOutput.test_history_search) ... ok
test_history_with_multiline_entries (test.test_pyrepl.test_pyrepl.TestPyReplOutput.test_history_with_multiline_entries) ... ok
test_multiline_edit (test.test_pyrepl.test_pyrepl.TestPyReplOutput.test_multiline_edit) ... ok
test_stdin_is_tty (test.test_pyrepl.test_pyrepl.TestPyReplOutput.test_stdin_is_tty) ... ok
test_stdout_is_tty (test.test_pyrepl.test_pyrepl.TestPyReplOutput.test_stdout_is_tty) ... skipped 'stdout is not a tty'
test_calc_screen_backspace (test.test_pyrepl.test_reader.TestReader.test_calc_screen_backspace) ... ok
test_calc_screen_backspace_in_second_line_after_wrap (test.test_pyrepl.test_reader.TestReader.test_calc_screen_backspace_in_second_line_after_wrap) ... ok
test_calc_screen_wrap_removes_after_backspace (test.test_pyrepl.test_reader.TestReader.test_calc_screen_wrap_removes_after_backspace) ... ok
test_calc_screen_wrap_simple (test.test_pyrepl.test_reader.TestReader.test_calc_screen_wrap_simple) ... ok
test_calc_screen_wrap_three_lines (test.test_pyrepl.test_reader.TestReader.test_calc_screen_wrap_three_lines) ... ok
test_calc_screen_wrap_three_lines_mixed_character (test.test_pyrepl.test_reader.TestReader.test_calc_screen_wrap_three_lines_mixed_character) ... ok
test_calc_screen_wrap_wide_characters (test.test_pyrepl.test_reader.TestReader.test_calc_screen_wrap_wide_characters) ... ok
test_completions_updated_on_key_press (test.test_pyrepl.test_reader.TestReader.test_completions_updated_on_key_press) ... ok
test_control_characters (test.test_pyrepl.test_reader.TestReader.test_control_characters) ... ok
test_input_hook_is_called_if_set (test.test_pyrepl.test_reader.TestReader.test_input_hook_is_called_if_set) ... ok
test_key_press_on_tab_press_once (test.test_pyrepl.test_reader.TestReader.test_key_press_on_tab_press_once) ... ok
test_keyboard_interrupt_clears_screen (test.test_pyrepl.test_reader.TestReader.test_keyboard_interrupt_clears_screen) ... ok
test_newline_within_block_trailing_whitespace (test.test_pyrepl.test_reader.TestReader.test_newline_within_block_trailing_whitespace) ... ok
test_prompt_length (test.test_pyrepl.test_reader.TestReader.test_prompt_length) ... ok
test_setpos_for_xy_simple (test.test_pyrepl.test_reader.TestReader.test_setpos_for_xy_simple) ... ok
test_setpos_from_xy_after_wrap (test.test_pyrepl.test_reader.TestReader.test_setpos_from_xy_after_wrap) ... ok
test_setpos_from_xy_multiple_lines (test.test_pyrepl.test_reader.TestReader.test_setpos_from_xy_multiple_lines) ... ok
test_setpos_fromxy_in_wrapped_line (test.test_pyrepl.test_reader.TestReader.test_setpos_fromxy_in_wrapped_line) ... ok
test_up_arrow_after_ctrl_r (test.test_pyrepl.test_reader.TestReader.test_up_arrow_after_ctrl_r) ... ok
test_cursor_back_write (test.test_pyrepl.test_unix_console.TestConsole.test_cursor_back_write) ... ok
test_cursor_left (test.test_pyrepl.test_unix_console.TestConsole.test_cursor_left) ... ok
test_cursor_left_right (test.test_pyrepl.test_unix_console.TestConsole.test_cursor_left_right) ... ok
test_cursor_up (test.test_pyrepl.test_unix_console.TestConsole.test_cursor_up) ... ok
test_cursor_up_down (test.test_pyrepl.test_unix_console.TestConsole.test_cursor_up_down) ... ok
test_multiline_function_move_up_down_short_terminal (test.test_pyrepl.test_unix_console.TestConsole.test_multiline_function_move_up_down_short_terminal) ... ok
test_multiline_function_move_up_short_terminal (test.test_pyrepl.test_unix_console.TestConsole.test_multiline_function_move_up_short_terminal) ... ok
test_resize_bigger_on_multiline_function (test.test_pyrepl.test_unix_console.TestConsole.test_resize_bigger_on_multiline_function) ... ok
test_resize_smaller_on_multiline_function (test.test_pyrepl.test_unix_console.TestConsole.test_resize_smaller_on_multiline_function) ... ok
test_simple_addition (test.test_pyrepl.test_unix_console.TestConsole.test_simple_addition) ... ok
test_wrap (test.test_pyrepl.test_unix_console.TestConsole.test_wrap) ... ok
test_empty (test.test_pyrepl.test_unix_eventqueue.TestUnixEventQueue.test_empty) ... ok
test_flush_buf (test.test_pyrepl.test_unix_eventqueue.TestUnixEventQueue.test_flush_buf) ... ok
test_get (test.test_pyrepl.test_unix_eventqueue.TestUnixEventQueue.test_get) ... ok
test_insert (test.test_pyrepl.test_unix_eventqueue.TestUnixEventQueue.test_insert) ... ok
test_push_special_key (test.test_pyrepl.test_unix_eventqueue.TestUnixEventQueue.test_push_special_key) ... ok
test_push_unrecognized_escape_sequence (test.test_pyrepl.test_unix_eventqueue.TestUnixEventQueue.test_push_unrecognized_escape_sequence) ... ok
test_push_with_key_in_keymap (test.test_pyrepl.test_unix_eventqueue.TestUnixEventQueue.test_push_with_key_in_keymap) ... ok
test_push_with_keymap_in_keymap (test.test_pyrepl.test_unix_eventqueue.TestUnixEventQueue.test_push_with_keymap_in_keymap) ... ok
test_push_with_keymap_in_keymap_and_escape (test.test_pyrepl.test_unix_eventqueue.TestUnixEventQueue.test_push_with_keymap_in_keymap_and_escape) ... ok
test_push_without_key_in_keymap (test.test_pyrepl.test_unix_eventqueue.TestUnixEventQueue.test_push_without_key_in_keymap) ... ok
test.test_pyrepl.test_windows_console (unittest.loader.ModuleSkipped.test.test_pyrepl.test_windows_console) ... skipped 'test only relevant on win32'

======================================================================
FAIL: test_inspect_keeps_globals_from_inspected_file (test.test_pyrepl.test_pyrepl.TestMain.test_inspect_keeps_globals_from_inspected_file) (var='FOO', expected='42')
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/mgorny/git/cpython/Lib/test/test_pyrepl/test_pyrepl.py", line 995, in _run_repl_globals_test
    self.fail(f"{var}= not found in output")
    ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: FOO= not found in output

======================================================================
FAIL: test_inspect_keeps_globals_from_inspected_module (test.test_pyrepl.test_pyrepl.TestMain.test_inspect_keeps_globals_from_inspected_module) (var='__package__', expected="'blue'")
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/mgorny/git/cpython/Lib/test/test_pyrepl/test_pyrepl.py", line 995, in _run_repl_globals_test
    self.fail(f"{var}= not found in output")
    ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: __package__= not found in output

======================================================================
FAIL: test_inspect_keeps_globals_from_inspected_module (test.test_pyrepl.test_pyrepl.TestMain.test_inspect_keeps_globals_from_inspected_module) (var='__file__', expected=re.compile("^'.*calx.py'$"))
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/mgorny/git/cpython/Lib/test/test_pyrepl/test_pyrepl.py", line 995, in _run_repl_globals_test
    self.fail(f"{var}= not found in output")
    ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: __file__= not found in output

----------------------------------------------------------------------
Ran 135 tests in 1.340s

FAILED (failures=3, skipped=2)
test test_pyrepl failed

== Tests result: FAILURE ==

10 slowest tests:
- test_pyrepl: 1.7 sec

1 test failed:
    test_pyrepl

0:00:01 load avg: 14.21 Re-running 1 failed tests in verbose mode in subprocesses
0:00:01 load avg: 14.21 Run 1 test in parallel using 1 worker process (timeout: 10 min, worker timeout: 15 min)
0:00:02 load avg: 14.21 [1/1/1] test_pyrepl failed (3 failures)
Re-running test_pyrepl in verbose mode (matching: test_inspect_keeps_globals_from_inspected_file, test_inspect_keeps_globals_from_inspected_module, test_inspect_keeps_globals_from_inspected_module)
test_inspect_keeps_globals_from_inspected_file (test.test_pyrepl.test_pyrepl.TestMain.test_inspect_keeps_globals_from_inspected_file) ... 
  test_inspect_keeps_globals_from_inspected_file (test.test_pyrepl.test_pyrepl.TestMain.test_inspect_keeps_globals_from_inspected_file) (var='__name__', expected="'__main__'") ... FAIL
  test_inspect_keeps_globals_from_inspected_file (test.test_pyrepl.test_pyrepl.TestMain.test_inspect_keeps_globals_from_inspected_file) (var='__package__', expected='None') ... FAIL
test_inspect_keeps_globals_from_inspected_module (test.test_pyrepl.test_pyrepl.TestMain.test_inspect_keeps_globals_from_inspected_module) ... 
  test_inspect_keeps_globals_from_inspected_module (test.test_pyrepl.test_pyrepl.TestMain.test_inspect_keeps_globals_from_inspected_module) (var='__name__', expected="'__main__'") ... FAIL

======================================================================
FAIL: test_inspect_keeps_globals_from_inspected_file (test.test_pyrepl.test_pyrepl.TestMain.test_inspect_keeps_globals_from_inspected_file) (var='__name__', expected="'__main__'")
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/mgorny/git/cpython/Lib/test/test_pyrepl/test_pyrepl.py", line 995, in _run_repl_globals_test
    self.fail(f"{var}= not found in output")
    ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: __name__= not found in output

======================================================================
FAIL: test_inspect_keeps_globals_from_inspected_file (test.test_pyrepl.test_pyrepl.TestMain.test_inspect_keeps_globals_from_inspected_file) (var='__package__', expected='None')
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/mgorny/git/cpython/Lib/test/test_pyrepl/test_pyrepl.py", line 995, in _run_repl_globals_test
    self.fail(f"{var}= not found in output")
    ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: __package__= not found in output

======================================================================
FAIL: test_inspect_keeps_globals_from_inspected_module (test.test_pyrepl.test_pyrepl.TestMain.test_inspect_keeps_globals_from_inspected_module) (var='__name__', expected="'__main__'")
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/mgorny/git/cpython/Lib/test/test_pyrepl/test_pyrepl.py", line 995, in _run_repl_globals_test
    self.fail(f"{var}= not found in output")
    ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: __name__= not found in output

----------------------------------------------------------------------
Ran 2 tests in 0.205s

FAILED (failures=3)
test test_pyrepl failed
1 test failed again:
    test_pyrepl

== Tests result: FAILURE then FAILURE ==

10 slowest tests:
- test_pyrepl: 1.7 sec

1 re-run test:
    test_pyrepl

1 test failed:
    test_pyrepl

Total duration: 2.1 sec
Total tests: run=137 failures=6 skipped=2
Total test files: run=2/1 failed=1 rerun=1
Result: FAILURE then FAILURE

This is with 3.13.0b4.

CPython versions tested on:

3.13

Operating systems tested on:

Linux

Linked PRs

@mgorny mgorny added the type-bug An unexpected behavior, bug, or error label Jul 18, 2024
@AlexWaygood AlexWaygood added tests Tests in the Lib/test dir topic-repl Related to the interactive shell labels Jul 18, 2024
colesbury added a commit to colesbury/cpython that referenced this issue Jul 22, 2024
This fixes the flakiness in:
* test_inspect_keeps_globals_from_inspected_file
* test_inspect_keeps_globals_from_inspected_module

The output already includes newlines. Adding newlines for every entry in
the output list introduces non-determinism because it added '\n' in
places where stdout is flushed or some buffer becomes full.

The regex also needed to be updated because pyrepl includes control
characters -- the visible output on each line doesn't immediately follow
a newline character.
ambv added a commit that referenced this issue Jul 23, 2024
This fixes the flakiness in:
* test_inspect_keeps_globals_from_inspected_file
* test_inspect_keeps_globals_from_inspected_module

The output already includes newlines. Adding newlines for every entry in
the output list introduces non-determinism because it added '\n' in
places where stdout is flushed or some buffer becomes full.

The regex also needed to be updated because pyrepl includes control
characters -- the visible output on each line doesn't immediately follow
a newline character.

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Jul 23, 2024
This fixes the flakiness in:
* test_inspect_keeps_globals_from_inspected_file
* test_inspect_keeps_globals_from_inspected_module

The output already includes newlines. Adding newlines for every entry in
the output list introduces non-determinism because it added '\n' in
places where stdout is flushed or some buffer becomes full.

The regex also needed to be updated because pyrepl includes control
characters -- the visible output on each line doesn't immediately follow
a newline character.

(cherry picked from commit 2c1b1e7)

Co-authored-by: Sam Gross <colesbury@gmail.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
ambv added a commit that referenced this issue Jul 23, 2024
This fixes the flakiness in:
* test_inspect_keeps_globals_from_inspected_file
* test_inspect_keeps_globals_from_inspected_module

The output already includes newlines. Adding newlines for every entry in
the output list introduces non-determinism because it added '\n' in
places where stdout is flushed or some buffer becomes full.

The regex also needed to be updated because pyrepl includes control
characters -- the visible output on each line doesn't immediately follow
a newline character.

(cherry picked from commit 2c1b1e7)

Co-authored-by: Sam Gross <colesbury@gmail.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
@ambv ambv closed this as completed Jul 23, 2024
nohlson pushed a commit to nohlson/cpython that referenced this issue Jul 24, 2024
This fixes the flakiness in:
* test_inspect_keeps_globals_from_inspected_file
* test_inspect_keeps_globals_from_inspected_module

The output already includes newlines. Adding newlines for every entry in
the output list introduces non-determinism because it added '\n' in
places where stdout is flushed or some buffer becomes full.

The regex also needed to be updated because pyrepl includes control
characters -- the visible output on each line doesn't immediately follow
a newline character.

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
nohlson pushed a commit to nohlson/cpython that referenced this issue Jul 24, 2024
This fixes the flakiness in:
* test_inspect_keeps_globals_from_inspected_file
* test_inspect_keeps_globals_from_inspected_module

The output already includes newlines. Adding newlines for every entry in
the output list introduces non-determinism because it added '\n' in
places where stdout is flushed or some buffer becomes full.

The regex also needed to be updated because pyrepl includes control
characters -- the visible output on each line doesn't immediately follow
a newline character.

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests Tests in the Lib/test dir topic-repl Related to the interactive shell type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

3 participants