File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -174,6 +174,7 @@ def testAppendChild(self):
174174 self .assertEqual (dom .documentElement .childNodes [- 1 ].data , "Hello" )
175175 dom .unlink ()
176176
177+ @support .requires_resource ('cpu' )
177178 def testAppendChildNoQuadraticComplexity (self ):
178179 impl = getDOMImplementation ()
179180
@@ -182,14 +183,18 @@ def testAppendChildNoQuadraticComplexity(self):
182183 children = [newdoc .createElement (f"child-{ i } " ) for i in range (1 , 2 ** 15 + 1 )]
183184 element = top_element
184185
185- start = time .time ()
186+ start = time .monotonic ()
186187 for child in children :
187188 element .appendChild (child )
188189 element = child
189- end = time .time ()
190+ end = time .monotonic ()
190191
191192 # This example used to take at least 30 seconds.
192- self .assertLess (end - start , 1 )
193+ # Conservative assertion due to the wide variety of systems and
194+ # build configs timing based tests wind up run under.
195+ # A --with-address-sanitizer --with-pydebug build on a rpi5 still
196+ # completes this loop in <0.5 seconds.
197+ self .assertLess (end - start , 4 )
193198
194199 def testSetAttributeNodeWithoutOwnerDocument (self ):
195200 # regression test for gh-142754
You can’t perform that action at this time.
0 commit comments