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

Flaky test_annotationlib test due to non-deterministic set iteration ordering #144348

Open
Assignees
JelleZijlstra
Labels
3.14bugs and security fixestestsTests in the Lib/test dirtopic-typingtype-bugAn unexpected behavior, bug, or error
@colesbury

Description

@colesbury

Seen in a 3.14 buildbot

test_type_repr (test.test_annotationlib.TestTypeRepr.test_type_repr) ... ok======================================================================FAIL: test_nonexistent_attribute (test.test_annotationlib.TestForwardRefFormat.test_nonexistent_attribute)----------------------------------------------------------------------Traceback (most recent call last):  File "/buildbot/buildarea/3.14.ware-debian-x86.installed/build/target/lib/python3.14/test/test_annotationlib.py", line 161, in test_nonexistent_attribute    self.assertEqual(epsilon_anno, support.EqualToForwardRef("some | {obj, module}", owner=f))    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^AssertionError: ForwardRef('some | {module, obj}', owner=[79 chars]810>) != EqualToForwardRef('some | {obj, module}',[86 chars]810>)----------------------------------------------------------------------Ran 110 tests in 0.079sFAILED (failures=1)

https://buildbot.python.org/#/builders/1793/builds/879/steps/8/logs/stdio

I stuck this into Claude and it the cause was due to non-deterministic set ordering, which I think is correct. I stuck arandom.shuffle(elts) below and was able to repro the issue locally:

eliftype(other)in (list,tuple,set):
extra_names= {}
elts= []
foreltinother:
new_elt,new_extra_names=self.__convert_to_ast(elt)
ifnew_extra_namesisnotNone:
extra_names.update(new_extra_names)
elts.append(new_elt)
ast_class= {list:ast.List,tuple:ast.Tuple,set:ast.Set}[type(other)]
returnast_class(elts),extra_names

Looks related to:

cc@JelleZijlstra

Linked PRs

Metadata

Metadata

Assignees

Labels

3.14bugs and security fixestestsTests in the Lib/test dirtopic-typingtype-bugAn unexpected behavior, bug, or error

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2026 Movatter.jp