Skip to content

Move resource.struct_rusage import #11343

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

Merged
merged 1 commit into from
Jan 30, 2024
Merged

Conversation

hauntsaninja
Copy link
Collaborator

@hauntsaninja hauntsaninja commented Jan 30, 2024

Fixes #11220

17 iterations of Alex's script and counting...

@hauntsaninja
Copy link
Collaborator Author

hauntsaninja commented Jan 30, 2024

Oh no..... on the eighteenth iteration I get:

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/root/.pyenv/versions/3.11.7/lib/python3.11/site-packages/mypy/__main__.py", line 37, in <module>
    console_entry()
  File "/root/.pyenv/versions/3.11.7/lib/python3.11/site-packages/mypy/__main__.py", line 15, in console_entry
    main()
  File "mypy/main.py", line 100, in main
  File "mypy/main.py", line 182, in run_build
  File "mypy/build.py", line 191, in build
  File "mypy/build.py", line 265, in _build
  File "mypy/build.py", line 2943, in dispatch
  File "mypy/build.py", line 3334, in process_graph
  File "mypy/build.py", line 3415, in process_fresh_modules
  File "mypy/build.py", line 2111, in fix_cross_refs
  File "mypy/fixup.py", line 52, in fixup_module
  File "mypy/fixup.py", line 127, in visit_symbol_table
  File "mypy/lookup.py", line 31, in lookup_fully_qualified
AssertionError: Cannot find module for _winapi.ABOVE_NORMAL_PRIORITY_CLASS

I'll get a bigger sample size and see if this is still worth merging

Copy link
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

@JelleZijlstra
Copy link
Member

At least that's a different import, wasn't it always struct_rusage before?

Copy link
Collaborator Author

@hauntsaninja hauntsaninja left a comment

Choose a reason for hiding this comment

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

I also see struct_rusage in some failures. With larger sample size, I'm not sure that this is any better, but don't think this is any worse. I kind of prefer this aesthetically, so I'm going to merge it and we'll see if it makes any marginal difference.

I'm getting flaky failures going back several months too. My guess is we just shouldn't be invoking mypy in parallel or should be setting --no-incremental or something.

@hauntsaninja hauntsaninja merged commit 9d445b0 into python:main Jan 30, 2024
@hauntsaninja hauntsaninja deleted the fix-struct branch January 30, 2024 08:52
@AlexWaygood
Copy link
Member

My current working theory is that there was a latent race condition (due to running many mypys concurrently) that was already present (and has probably always been present since #10714), but was recently made significantly more likely to occur, probably due to our import cycles getting worse

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Flaky mypy error on typeshed test_cases
4 participants