@@ -38,15 +38,15 @@ def to_raise(msg):
3838 assert 3.0 == await pm .eval ("new Promise((resolve) => setTimeout(function(){ resolve(arguments.length) }, 100, 90, 91, 92))" )
3939 assert 92.0 == await pm .eval ("new Promise((resolve) => setTimeout((...args) => { resolve(args[2]) }, 100, 90, 91, 92))" )
4040 # test `setTimeout` setting delay to 0 if < 0
41- await asyncio .wait_for (pm .eval ("new Promise((resolve) => setTimeout(resolve, 0))" ), timeout = 0.02 )
42- await asyncio .wait_for (pm .eval ("new Promise((resolve) => setTimeout(resolve, -10000))" ), timeout = 0.02 ) # won't be precisely 0s
41+ await asyncio .wait_for (pm .eval ("new Promise((resolve) => setTimeout(resolve, 0))" ), timeout = 0.05 )
42+ await asyncio .wait_for (pm .eval ("new Promise((resolve) => setTimeout(resolve, -10000))" ), timeout = 0.05 ) # won't be precisely 0s
4343 # test `setTimeout` accepting string as the delay, coercing to a number.
44- # Number('100') -> 100, pass if the actual delay is > 90ms and < 120ms
45- await asyncio .wait_for (pm .eval ("new Promise((resolve) => setTimeout(resolve, '100'))" ), timeout = 0.12 ) # won't be precisely 100ms
44+ # Number('100') -> 100, pass if the actual delay is > 90ms and < 150ms
45+ await asyncio .wait_for (pm .eval ("new Promise((resolve) => setTimeout(resolve, '100'))" ), timeout = 0.15 ) # won't be precisely 100ms
4646 with pytest .raises (asyncio .exceptions .TimeoutError ):
4747 await asyncio .wait_for (pm .eval ("new Promise((resolve) => setTimeout(resolve, '100'))" ), timeout = 0.09 )
4848 # Number("1 second") -> NaN -> delay turns to be 0s
49- await asyncio .wait_for (pm .eval ("new Promise((resolve) => setTimeout(resolve, '1 second'))" ), timeout = 0.02 ) # won't be precisely 0s
49+ await asyncio .wait_for (pm .eval ("new Promise((resolve) => setTimeout(resolve, '1 second'))" ), timeout = 0.05 ) # won't be precisely 0s
5050
5151 # passing an invalid ID to `clearTimeout` should silently do nothing; no exception is thrown.
5252 pm .eval ("clearTimeout(NaN)" )
0 commit comments