deltachat-core-rust
deltachat-core-rust copied to clipboard
JSON-RPC python tests frequently fail with OSError: [Errno 9] Bad file descriptor
Failure looks like this:
================================== FAILURES ===================================
_______________________________ test_acfactory ________________________________
[gw1] win32 -- Python 3.13.0 D:\a\deltachat-core-rust\deltachat-core-rust\deltachat-rpc-client\.tox\py\Scripts\python.EXE
acfactory = <deltachat_rpc_client.pytestplugin.ACFactory object at 0x000002049AC1DB50>
def test_acfactory(acfactory) -> None:
account = acfactory.new_configured_account()
while True:
event = account.wait_for_event()
if event.kind == EventType.CONFIGURE_PROGRESS:
assert event.progress != 0 # Progress 0 indicates error.
if event.progress == 1000: # Success
break
else:
> print(event)
E OSError: [Errno 9] Bad file descriptor
tests\test_something.py:60: OSError
This looks like a problem with print
usage in pytest when print attempts to print directly and something else (pytest?) closed the file descriptor.
pytest is configured in tox.ini
with log_cli = true
, maybe this changes something.
Here is CI log (from windows runner): job-logs.txt
This is not the result of teardown, because by the time test_acfactory
test failed with this print
exception only 50% of tests passed and other tests continue to run successfully.