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

Commita696ba8

Browse files
authored
[3.13]gh-142145: relax the no-longer-quadratic test timing (GH-143030) (#143032)
gh-142145: relax the no-longer-quadratic test timing (#143030)*gh-142145: relax the no-longer-quadratic test timing* require cpu resource(cherry picked from commit8d2d7bb)
1 parent86747f1 commita696ba8

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

‎Lib/test/test_minidom.py‎

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff 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
deftestAppendChildNoQuadraticComplexity(self):
178179
impl=getDOMImplementation()
179180

@@ -182,14 +183,18 @@ def testAppendChildNoQuadraticComplexity(self):
182183
children= [newdoc.createElement(f"child-{i}")foriinrange(1,2**15+1)]
183184
element=top_element
184185

185-
start=time.time()
186+
start=time.monotonic()
186187
forchildinchildren:
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,10)
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
deftestSetAttributeNodeWithoutOwnerDocument(self):
195200
# regression test for gh-142754

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp