Skip to content

Conversation

@Fidget-Spinner
Copy link
Member

@Fidget-SpinnerFidget-Spinner commented Feb 13, 2024

The optimizer does not optimize global loads if the builtins dictionary has been modified more than 3 times. In this case, I suspect some other test is modifying the builtins dictionary before test_capi.test_opt is run. So the test for the optimizer fails if tests are run sequentially.

The solution is to run the test in the subprocess so it's not subject to shenanigans that other tests do :).

@bedevere-appbedevere-appbot added the tests Tests in the Lib/test dir label Feb 13, 2024
@Fidget-Spinner
Copy link
MemberAuthor

Easy reproducer: thanks to @Eclips4

./python -m test test___all__ test__locale test__opcode test__osx_support test__xxinterpchannels test__xxsubinterpreters test_abc test_abstract_numbers test_argparse test_array test_asdl_parser test_ast test_asyncgen test_atexit test_audit test_augassign test_augassign test_baseexception test_bdb test_bigaddrspace test_bigmem test_binascii test_binop test_bisect test_bool test_buffer test_bufio test_builtin test_bytes test_bz2 test_c_locale_coercion test_calendar test_call test_capi 

@Eclips4
Copy link
Member

Easy reproducer: thanks to @Eclips4

./python -m test test___all__ test__locale test__opcode test__osx_support test__xxinterpchannels test__xxsubinterpreters test_abc test_abstract_numbers test_argparse test_array test_asdl_parser test_ast test_asyncgen test_atexit test_audit test_augassign test_augassign test_baseexception test_bdb test_bigaddrspace test_bigmem test_binascii test_binop test_bisect test_bool test_buffer test_bufio test_builtin test_bytes test_bz2 test_c_locale_coercion test_calendar test_call test_capi 

I found the more easier reproducer:

./python -m test test_argparse test_ast test_asyncgen test_capi 

@Eclips4
Copy link
Member

macOS failure is unrelated, see #115383 for more information

@Yhg1sYhg1s merged commit 57e4c81 into python:mainFeb 14, 2024
fsc-eriker pushed a commit to fsc-eriker/cpython that referenced this pull request Feb 14, 2024
@Fidget-SpinnerFidget-Spinner deleted the fix-globals-constants-test branch February 14, 2024 18:14
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip newstestsTests in the Lib/test dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@Fidget-Spinner@Eclips4@vstinner@Yhg1s