You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
Recently I've updated my tornado tests container to python:3.10-alpine3.15 from python:3.9.6-alpine3.14. After doing this, my tests started to fail with the error below.
tests/admin/handlers/data_collection/data_collection_test.py:233: in _create_task
response = self._fetch(TASKS_URI, body=json.dumps(task), method='POST')
tests/base.py:608: in _fetch
return self.fetch(*args, **kwargs)
/usr/local/lib/python3.10/site-packages/tornado/testing.py:443: in fetch
return self.io_loop.run_sync(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <tornado.platform.asyncio.AsyncIOLoop object at 0x7f43438c2ef0>, func = <function AsyncHTTPTestCase.fetch.<locals>.<lambda> at 0x7f43437497e0>, timeout = 300.0
def run_sync(self, func: Callable, timeout: Optional[float] = None) -> Any:
"""Starts the `IOLoop`, runs the given function, and stops the loop.
The function must return either an awaitable object or
``None``. If the function returns an awaitable object, the
`IOLoop` will run until the awaitable is resolved (and
`run_sync()` will return the awaitable's result). If it raises
an exception, the `IOLoop` will stop and the exception will be
re-raised to the caller.
The keyword-only argument ``timeout`` may be used to set
a maximum duration for the function. If the timeout expires,
a `tornado.util.TimeoutError` is raised.
This method is useful to allow asynchronous calls in a
``main()`` function::
async def main():
# do stuff...
if __name__ == '__main__':
IOLoop.current().run_sync(main)
.. versionchanged:: 4.3
Returning a non-``None``, non-awaitable value is now an error.
.. versionchanged:: 5.0
If a timeout occurs, the ``func`` coroutine will be cancelled.
"""
future_cell = [None] # type: List[Optional[Future]]
def run() -> None:
try:
result = func()
if result is not None:
from tornado.gen import convert_yielded
result = convert_yielded(result)
except Exception:
fut = Future() # type: Future[Any]
future_cell[0] = fut
future_set_exc_info(fut, sys.exc_info())
else:
if is_future(result):
future_cell[0] = result
else:
fut = Future()
future_cell[0] = fut
fut.set_result(result)
assert future_cell[0] is not None
self.add_future(future_cell[0], lambda future: self.stop())
self.add_callback(run)
if timeout is not None:
def timeout_callback() -> None:
# If we can cancel the future, do so and wait on it. If not,
# Just stop the loop and return with the task still pending.
# (If we neither cancel nor wait for the task, a warning
# will be logged).
assert future_cell[0] is not None
if not future_cell[0].cancel():
self.stop()
timeout_handle = self.add_timeout(self.time() + timeout, timeout_callback)
self.start()
if timeout is not None:
self.remove_timeout(timeout_handle)
assert future_cell[0] is not None
if future_cell[0].cancelled() or not future_cell[0].done():
raise TimeoutError("Operation timed out after %s seconds" % timeout)
> return future_cell[0].result()
E tornado.curl_httpclient.CurlError: HTTP 599: Failed writing header
/usr/local/lib/python3.10/site-packages/tornado/ioloop.py:530: CurlError
The text was updated successfully, but these errors were encountered:
I have no idea what might be causing this, but I noticed nest-asyncio in your dependencies list, and I'm suspicious of that package. Nesting asyncio event loops in the wrong places could cause all kinds of undefined behavior.
Hi,
Recently I've updated my tornado tests container to python:3.10-alpine3.15 from python:3.9.6-alpine3.14. After doing this, my tests started to fail with the error below.
These are my dependencies:
Any idea what could cause this errors?
Thanks
The text was updated successfully, but these errors were encountered: