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_traceback: test_import_from_error_bad_suggestions_do_not_trigger_for_small_names() fails randomly on "wasm32-emscripten node (dynamic linking)" buildbot #99894

Closed
vstinner opened this issue Nov 30, 2022 · 7 comments
Labels
type-bug An unexpected behavior, bug, or error

Comments

@vstinner
Copy link
Member

vstinner commented Nov 30, 2022

test_traceback: test_import_from_error_bad_suggestions_do_not_trigger_for_small_names() fails randomly on the "wasm32-emscripten node (dynamic linking)" buildbot worker.

Example: https://buildbot.python.org/all/#/builders/1056/builds/928

FAIL: test_import_from_error_bad_suggestions_do_not_trigger_for_small_names (test.test_traceback.CPythonSuggestionFormattingTests.test_import_from_error_bad_suggestions_do_not_trigger_for_small_names) (name='b')
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/opt/buildbot/bcannon-wasm/3.x.bcannon-wasm.emscripten-node-dl/build/Lib/test/test_traceback.py", line 3173, in test_import_from_error_bad_suggestions_do_not_trigger_for_small_names
    self.assertNotIn("mom", actual)
AssertionError: 'mom' unexpectedly found in "ImportError: cannot import name 'b' from 'IMwPxQRPpcEcmomu' (/tmp/tmpanzezi5a/IMwPxQRPpcEcmomu.py)"

cc @brettcannon @tiran @pablogsal

Linked PRs

@vstinner vstinner added the type-bug An unexpected behavior, bug, or error label Nov 30, 2022
@vstinner
Copy link
Member Author

Other failures:

@pablogsal
Copy link
Member

On it

@vstinner
Copy link
Member Author

vstinner commented Nov 30, 2022

I'm able to reproduce the issue on my x86-64 Fedora 37:

$ ./python -m test test_traceback -j20 -F -m test_import_from_error_bad_suggestions_do_not_trigger_for_small_names -v
(...)
0:00:08 load avg: 22.67 [ 56/1] test_traceback failed (1 failure)
test_import_from_error_bad_suggestions_do_not_trigger_for_small_names (test.test_traceback.CPythonSuggestionFormattingTests.test_import_from_error_bad_suggestions_do_not_trigger_for_small_names) ... 
  test_import_from_error_bad_suggestions_do_not_trigger_for_small_names (test.test_traceback.CPythonSuggestionFormattingTests.test_import_from_error_bad_suggestions_do_not_trigger_for_small_names) (name='py') ... FAIL
test_import_from_error_bad_suggestions_do_not_trigger_for_small_names (test.test_traceback.PurePythonSuggestionFormattingTests.test_import_from_error_bad_suggestions_do_not_trigger_for_small_names) ... ok

======================================================================
FAIL: test_import_from_error_bad_suggestions_do_not_trigger_for_small_names (test.test_traceback.CPythonSuggestionFormattingTests.test_import_from_error_bad_suggestions_do_not_trigger_for_small_names) (name='py')
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/vstinner/python/main/Lib/test/test_traceback.py", line 3173, in test_import_from_error_bad_suggestions_do_not_trigger_for_small_names
    self.assertNotIn("mom", actual)
AssertionError: 'mom' unexpectedly found in "ImportError: cannot import name 'py' from 'bGamirGQRkOmsncE' (/tmp/test_python_f0fe4pnw/tmpzmomru6k/bGamirGQRkOmsncE.py)"

----------------------------------------------------------------------
Ran 2 tests in 0.273s
(...)
Total duration: 9.0 sec
Tests result: FAILURE

EDIT: Oh I forgot that to trigger the bug, I had to stress my machine by running ./python -m test -j4 -F in a different terminal. My laptop has 6 CPU cores (12 threads).

@pablogsal
Copy link
Member

I made a PR for this

@vstinner
Copy link
Member Author

LoooooooL, I think that I understood the issue 😄 Funny one.

@vstinner
Copy link
Member Author

On main, I can reproduce the issue quickly with commands that I gave in a previous comment:

  • 9 seconds: 'mom' unexpectedly found
  • 24 seconds: 'vvv' unexpectedly found
  • 10 seconds: 'vvv' unexpectedly found
  • 1 min 17 sec: 'mom' unexpectedly found

pablogsal added a commit to pablogsal/cpython that referenced this issue Nov 30, 2022
…test file in traceback suggestion error checking
vstinner added a commit that referenced this issue Dec 1, 2022
…traceback suggestion error checking (#99895)

Co-authored-by: Victor Stinner <vstinner@python.org>
@vstinner
Copy link
Member Author

vstinner commented Dec 1, 2022

Fixed by 0563be2

@vstinner vstinner closed this as completed Dec 1, 2022
carljm added a commit to carljm/cpython that referenced this issue Dec 1, 2022
* main: (112 commits)
  pythongh-99894: Ensure the local names don't collide with the test file in traceback suggestion error checking (python#99895)
  pythongh-99612: Fix PyUnicode_DecodeUTF8Stateful() for ASCII-only data (pythonGH-99613)
  Doc: Add summary line to isolation_level & autocommit sqlite3.connect params (python#99917)
  pythonGH-98906 ```re``` module: ```search() vs. match()``` section should mention ```fullmatch()``` (pythonGH-98916)
  pythongh-89189: More compact range iterator (pythonGH-27986)
  bpo-47220: Document the optional callback parameter of weakref.WeakMethod (pythonGH-25491)
  pythonGH-99905: Fix output of misses in summarize_stats.py execution counts (pythonGH-99906)
  pythongh-99845: PEP 670: Convert PyObject macros to functions (python#99850)
  pythongh-99845: Use size_t type in __sizeof__() methods (python#99846)
  pythonGH-99877)
  Fix typo in exception message in `multiprocessing.pool` (python#99900)
  pythongh-87092: move all localsplus preparation into separate function called from assembler stage (pythonGH-99869)
  pythongh-99891: Fix infinite recursion in the tokenizer when showing warnings (pythonGH-99893)
  pythongh-99824: Document that sqlite3.connect implicitly open a transaction if autocommit=False (python#99825)
  pythonGH-81057: remove static state from suggestions.c (python#99411)
  Improve zip64 limit error message (python#95892)
  pythongh-98253: Break potential reference cycles in external code worsened by typing.py lru_cache (python#98591)
  pythongh-99127: Allow some features of syslog to the main interpreter only (pythongh-99128)
  pythongh-82836: fix private network check (python#97733)
  Docs: improve accuracy of socketserver reference (python#24767)
  ...
sobolevn added a commit to sobolevn/cpython that referenced this issue Dec 28, 2022
… test file in traceback suggestion error checking (python#99895)"

This reverts commit 0563be2.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

2 participants