Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BlockingIOError: [Errno 11] write could not complete without blocking #3171

Closed
codingjoe opened this issue Jan 31, 2018 · 9 comments
Closed
Labels
type: bug problem that needs to be addressed type: question general question, might be closed after 2 weeks of inactivity

Comments

@codingjoe
Copy link
Contributor

OS: Ubuntu Trusty (travis-ci; container; sudo=false)
Python: 3.6.4  
xdist: n3

There isn't much I can explain, but that this happens to some, but not all our test groups. Happens only with the latest release.

Exception

Traceback (most recent call last):
  File "/home/travis/virtualenv/python3.6.4/bin/py.test", line 11, in <module>
    sys.exit(main())
  File "/home/travis/virtualenv/python3.6.4/lib/python3.6/site-packages/_pytest/config.py", line 59, in main
    return config.hook.pytest_cmdline_main(config=config)
  File "/home/travis/virtualenv/python3.6.4/lib/python3.6/site-packages/pluggy/__init__.py", line 617, in __call__
    return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
  File "/home/travis/virtualenv/python3.6.4/lib/python3.6/site-packages/pluggy/__init__.py", line 222, in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
  File "/home/travis/virtualenv/python3.6.4/lib/python3.6/site-packages/pluggy/__init__.py", line 216, in <lambda>
    firstresult=hook.spec_opts.get('firstresult'),
  File "/home/travis/virtualenv/python3.6.4/lib/python3.6/site-packages/pluggy/callers.py", line 180, in _multicall
    res = hook_impl.function(*args)
  File "/home/travis/virtualenv/python3.6.4/lib/python3.6/site-packages/pluggy/callers.py", line 76, in get_result
    raise ex[1].with_traceback(ex[2])
  File "/home/travis/virtualenv/python3.6.4/lib/python3.6/site-packages/pluggy/callers.py", line 180, in _multicall
    res = hook_impl.function(*args)
  File "/home/travis/virtualenv/python3.6.4/lib/python3.6/site-packages/_pytest/main.py", line 131, in pytest_cmdline_main
    return wrap_session(config, _main)
  File "/home/travis/virtualenv/python3.6.4/lib/python3.6/site-packages/_pytest/main.py", line 100, in wrap_session
    session.exitstatus = doit(config, session) or 0
  File "/home/travis/virtualenv/python3.6.4/lib/python3.6/site-packages/pluggy/__init__.py", line 617, in __call__
    return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
  File "/home/travis/virtualenv/python3.6.4/lib/python3.6/site-packages/pluggy/__init__.py", line 222, in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
  File "/home/travis/virtualenv/python3.6.4/lib/python3.6/site-packages/pluggy/__init__.py", line 216, in <lambda>
    firstresult=hook.spec_opts.get('firstresult'),
  File "/home/travis/virtualenv/python3.6.4/lib/python3.6/site-packages/pluggy/callers.py", line 196, in _multicall
    gen.send(outcome)
  File "/home/travis/virtualenv/python3.6.4/lib/python3.6/site-packages/_pytest/terminal.py", line 474, in pytest_sessionfinish
    exitstatus=exitstatus)
  File "/home/travis/virtualenv/python3.6.4/lib/python3.6/site-packages/pluggy/__init__.py", line 617, in __call__
    return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
  File "/home/travis/virtualenv/python3.6.4/lib/python3.6/site-packages/pluggy/__init__.py", line 222, in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
  File "/home/travis/virtualenv/python3.6.4/lib/python3.6/site-packages/pluggy/__init__.py", line 216, in <lambda>
    firstresult=hook.spec_opts.get('firstresult'),
  File "/home/travis/virtualenv/python3.6.4/lib/python3.6/site-packages/pluggy/callers.py", line 201, in _multicall
    return outcome.get_result()
  File "/home/travis/virtualenv/python3.6.4/lib/python3.6/site-packages/pluggy/callers.py", line 76, in get_result
    raise ex[1].with_traceback(ex[2])
  File "/home/travis/virtualenv/python3.6.4/lib/python3.6/site-packages/pluggy/callers.py", line 180, in _multicall
    res = hook_impl.function(*args)
  File "/home/travis/virtualenv/python3.6.4/lib/python3.6/site-packages/_pytest/skipping.py", line 313, in pytest_terminal_summary
    tr._tw.line(line)
  File "/home/travis/virtualenv/python3.6.4/lib/python3.6/site-packages/py/_io/terminalwriter.py", line 234, in line
    self.write(s, **kw)
  File "/home/travis/virtualenv/python3.6.4/lib/python3.6/site-packages/py/_io/terminalwriter.py", line 224, in write
    write_out(self._file, markupmsg)
  File "/home/travis/virtualenv/python3.6.4/lib/python3.6/site-packages/py/_io/terminalwriter.py", line 384, in write_out
    fil.flush()
BlockingIOError: [Errno 11] write could not complete without blocking

requirements.txt

-e git+https://github.com/Thermondo/[email protected]#egg=drf-extensions
-e git+https://[email protected]/Thermondo/[email protected]#egg=thermondo-salesforce
alabaster==0.7.10
amqp==2.2.2
apipkg==1.4
aspy.yaml==1.0.0
astroid==1.6.1
attrs==17.4.0
babel==2.5.2
bandit==1.4.0
beautifulsoup4==4.6.0
billiard==3.5.0.3
bleach==2.1.2
boto3==1.5.4  # pyup: >=1.6
botocore==1.8.18  # pyup: >=1.9
cached-property==1.3.1
cachetools==2.0.1
celery==4.1.0
certifi==2018.1.18
chardet==3.0.4
click==6.7
codecov==2.0.15
contexttimer==0.3.3
coverage==4.4.2
defusedxml==0.5.0
dj-database-url==0.4.2
dj-email-url==0.0.10
django-admin-sortable==2.1.2
django-appconf==1.0.2
django-cache-url==2.0.0
django-configurations==2.0
django-cors-headers==2.1.0
django-crispy-forms==1.7.0
django-debug-toolbar==1.9.1
django-dirtyfields==1.3
django-extensions==1.9.9
django-extra-views==0.9.0
django-filter==1.1.0
django-formtools==2.1
django-fsm==2.6.0
django-fsm-admin==1.2.4
django-fsm-log==1.5.0
django-geoposition==0.3.0
django-health-check==3.4.1
django-heroku-connect==0.8.2
django-js-asset==1.0.0
django-jsonfield==1.0.1
django-localflavor==2.0
django-log-request-id==1.3.2
django-markdownx==2.0.22
django-measurement==3.0.0
django-model-utils==3.1.1
django-mptt==0.9.0
django-oauth-toolkit==1.0.0
django-orderable==5.0.0
django-pgviews==0.5.3
django-phaxio==2.0.0
django-redis==4.8.0
django-reversion==2.0.13
django-reversion-compare==0.8.3
django-s3file==1.2.1
django-select2==6.0.1
django-stdimage==3.0.0
django-storages==1.6.5
django-suit==0.2.25
django-viewflow==1.2.0
django-watson==1.5.0
django-webtest==1.9.2
django==1.11.9
djangorestframework-expander==0.2.3
djangorestframework==3.7.7
djorm-ext-pgfulltext==0.9.3  # pyup: !=0.10
docutils==0.14
drf-compound-fields==1.0.0
execnet==1.5.0
faster-closeio==1.0.0
first==2.0.1
freezegun==0.3.9
geopy==1.11.0
gitdb2==2.0.3
gitpython==2.1.8
google-api-python-client==1.6.5
google-auth-httplib2==0.0.3
google-auth==1.3.0
googlemaps==2.5.1
graphviz==0.8.2
hiredis==0.2.0
hirefire==0.5
html5lib==1.0.1
httplib2==0.10.3
identify==1.0.7
idna==2.6
ijson==2.3
imagesize==0.7.1
isort==4.2.15
isoweek==1.3.3
jinja2==2.10
jmespath==0.9.3
kombu==4.1.0
lazy-object-proxy==1.3.1
lxml==4.1.1
markdown==2.6.11
markupsafe==1.0
mccabe==0.6.1
measurement==2.0.1
model-mommy==1.5.1
money==1.3.0
mpmath==1.0.0
msgcheck==2.9
newrelic==2.100.0.84
nodeenv==1.2.0
numpy==1.14.0
oauth2client==4.1.2
oauthlib==2.0.6
olefile==0.45.1
orderedmultidict==0.7.11
pandas==0.19.2  # pyup: <0.20
pbr==3.1.1
phonenumberslite==8.8.10
pillow==5.0.0
pip-tools==1.11.0
polib==1.1.0
pluggy==0.6.0
pre-commit==1.5.1
progressbar2==3.34.3
psycopg2==2.7.3.2
py==1.5.2
pyasn1-modules==0.2.1
pyasn1==0.4.2
pycodestyle==2.3.1
pycrypto==2.6.1
pydocstyle==2.1.1
pyenchant==2.0.0
pygments==2.2.0
pyjwt==1.5.3
pylint-celery==0.3
pylint-plugin-utils==0.2.6
pylint==1.8.2
pypdf2==1.26.0
pysocks==1.6.8
pytest-cache==1.0
pytest-cov==2.5.1
pytest-django==3.1.2
pytest-forked==0.2
pytest-mock==1.6.3
pytest-rerunfailures==4.0
pytest-test-groups==1.0.3
pytest-translations==2.0.0
pytest-xdist==1.22.0
pytest==3.3.2
python-briefdruckzentrum==0.1.4
python-dateutil==2.6.1
python-utils==2.2.0
python3-openid==3.1.0
pytz==2017.3
pyyaml==3.12
raven==6.5.0
redis==2.10.6
requests-file==1.4.3
requests-mock==1.4.0
requests-oauthlib==0.8.0
requests==2.18.4
rsa==3.4.2
s3transfer==0.1.12
scikit-learn==0.19.1
scipy==1.0.0
selenium==3.8.1
sendwithus==5.0.0
six==1.11.0
slumber==0.7.1
smmap2==2.0.3
snowballstemmer==1.2.1
social-auth-app-django==2.1.0
social-auth-core==1.6.0
sphinx-rtd-theme==0.2.4
sphinx==1.6.5
sphinxcontrib-spelling==4.0.1
sphinxcontrib-websupport==1.0.1
spyne==2.12.14
sqlparse==0.2.4
stevedore==1.28.0
sympy==1.1.1
tabulate==0.8.2
tldextract==2.2.0
twilio==6.10.1
typing==3.6.4
uritemplate==3.0.0
urllib3==1.22
viewflow-extensions==1.2.0
vine==1.1.4
virtualenv==15.1.0
waitress==1.1.0
webencodings==0.5.1
webob==1.7.4
webtest==2.0.29
werkzeug==0.14.1
whitenoise==3.3.1
workdays==1.4
wrapt==1.10.11
wsgi-sslify==1.0.1
xlrd==1.1.0
xmltodict==0.11.0
@pytestbot pytestbot added type: question general question, might be closed after 2 weeks of inactivity type: bug problem that needs to be addressed labels Jan 31, 2018
@codingjoe
Copy link
Contributor Author

Never mind, happened in an older version too!

@x007007007
Copy link

x007007007 commented Mar 7, 2018

Hi, @codingjoe ,I have same probably, Could you please tell how did you fix it .I run pytest only fail under jenkins .

src/xxxxxxxx/models/job_config_category.py                                                                   9      1      0      0    89%
src/xxxxxxxx/models/platform.py                                                                             13      1      0      0    92%
src/xxxxxxxx/models/team.py                                                                                  9      1      0      0    89%
src/fusion_build_config/models/trigger_frequency.py             Traceback (most recent call last):
  File "/home/administrator/slave/workspace/AAAAAA/env/lib/python3.5/site-packages/_pytest/config.py", line 59, in main
    return config.hook.pytest_cmdline_main(config=config)
  File "/home/administrator/slave/workspace/AAAAAA/env/lib/python3.5/site-packages/pluggy/__init__.py", line 617, in __call__
    return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
  File "/home/administrator/slave/workspace/AAAAAA/env/lib/python3.5/site-packages/pluggy/__init__.py", line 222, in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
  File "/home/administrator/slave/workspace/AAAAAA/env/lib/python3.5/site-packages/pluggy/__init__.py", line 216, in <lambda>
    firstresult=hook.spec_opts.get('firstresult'),
  File "/home/administrator/slave/workspace/AAAAAA/env/lib/python3.5/site-packages/pluggy/callers.py", line 180, in _multicall
    res = hook_impl.function(*args)
  File "/home/administrator/slave/workspace/AAAAAA/env/lib/python3.5/site-packages/pluggy/callers.py", line 76, in get_result
    raise ex[1].with_traceback(ex[2])
  File "/home/administrator/slave/workspace/AAAAAA/env/lib/python3.5/site-packages/pluggy/callers.py", line 180, in _multicall
    res = hook_impl.function(*args)
  File "/home/administrator/slave/workspace/AAAAAA/env/lib/python3.5/site-packages/_pytest/main.py", line 131, in pytest_cmdline_main
    return wrap_session(config, _main)
  File "/home/administrator/slave/workspace/AAAAAA/env/lib/python3.5/site-packages/_pytest/main.py", line 100, in wrap_session
    session.exitstatus = doit(config, session) or 0
  File "/home/administrator/slave/workspace/AAAAAA/env/lib/python3.5/site-packages/pluggy/__init__.py", line 617, in __call__
    return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
  File "/home/administrator/slave/workspace/AAAAAA/env/lib/python3.5/site-packages/pluggy/__init__.py", line 222, in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
  File "/home/administrator/slave/workspace/AAAAAA/env/lib/python3.5/site-packages/pluggy/__init__.py", line 216, in <lambda>
    firstresult=hook.spec_opts.get('firstresult'),
  File "/home/administrator/slave/workspace/AAAAAA/env/lib/python3.5/site-packages/pluggy/callers.py", line 196, in _multicall
    gen.send(outcome)
  File "/home/administrator/slave/workspace/AAAAAA/env/lib/python3.5/site-packages/_pytest/terminal.py", line 476, in pytest_sessionfinish
    exitstatus=exitstatus)
  File "/home/administrator/slave/workspace/AAAAAA/env/lib/python3.5/site-packages/pluggy/__init__.py", line 617, in __call__
    return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
  File "/home/administrator/slave/workspace/AAAAAA/env/lib/python3.5/site-packages/pluggy/__init__.py", line 222, in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
  File "/home/administrator/slave/workspace/AAAAAA/env/lib/python3.5/site-packages/pluggy/__init__.py", line 216, in <lambda>
    firstresult=hook.spec_opts.get('firstresult'),
  File "/home/administrator/slave/workspace/AAAAAA/env/lib/python3.5/site-packages/pluggy/callers.py", line 201, in _multicall
    return outcome.get_result()
  File "/home/administrator/slave/workspace/AAAAAA/env/lib/python3.5/site-packages/pluggy/callers.py", line 76, in get_result
    raise ex[1].with_traceback(ex[2])
  File "/home/administrator/slave/workspace/AAAAAA/env/lib/python3.5/site-packages/pluggy/callers.py", line 180, in _multicall
    res = hook_impl.function(*args)
  File "/home/administrator/slave/workspace/AAAAAA/env/lib/python3.5/site-packages/pytest_cov/plugin.py", line 262, in pytest_terminal_summary
    terminalreporter.write('\n' + self.cov_report.getvalue() + '\n')
  File "/home/administrator/slave/workspace/AAAAAA/env/lib/python3.5/site-packages/_pytest/terminal.py", line 198, in write
    self._tw.write(content, **markup)
  File "/home/administrator/slave/workspace/AAAAAA/env/lib/python3.5/site-packages/py/_io/terminalwriter.py", line 224, in write
    write_out(self._file, markupmsg)
  File "/home/administrator/slave/workspace/AAAAAA/env/lib/python3.5/site-packages/py/_io/terminalwriter.py", line 369, in write_out
    fil.write(msg)
BlockingIOError: [Errno 11] write could not complete without blocking

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/administrator/slave/workspace/AAAAAA/env/bin/pytest", line 11, in <module>
    sys.exit(main())
  File "/home/administrator/slave/workspace/AAAAAA/env/lib/python3.5/site-packages/_pytest/config.py", line 61, in main
    config._ensure_unconfigure()
  File "/home/administrator/slave/workspace/AAAAAA/env/lib/python3.5/site-packages/_pytest/config.py", line 927, in _ensure_unconfigure
    self.hook.pytest_unconfigure(config=self)
  File "/home/administrator/slave/workspace/AAAAAA/env/lib/python3.5/site-packages/pluggy/__init__.py", line 617, in __call__
    return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
  File "/home/administrator/slave/workspace/AAAAAA/env/lib/python3.5/site-packages/pluggy/__init__.py", line 222, in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
  File "/home/administrator/slave/workspace/AAAAAA/env/lib/python3.5/site-packages/pluggy/__init__.py", line 216, in <lambda>
    firstresult=hook.spec_opts.get('firstresult'),
  File "/home/administrator/slave/workspace/AAAAAA/env/lib/python3.5/site-packages/pluggy/callers.py", line 201, in _multicall
    return outcome.get_result()
  File "/home/administrator/slave/workspace/AAAAAA/env/lib/python3.5/site-packages/pluggy/callers.py", line 76, in get_result
    raise ex[1].with_traceback(ex[2])
  File "/home/administrator/slave/workspace/AAAAAA/env/lib/python3.5/site-packages/pluggy/callers.py", line 180, in _multicall
    res = hook_impl.function(*args)
  File "/home/administrator/slave/workspace/AAAAAA/env/lib/python3.5/site-packages/_pytest/terminal.py", line 492, in pytest_unconfigure
    self._report_keyboardinterrupt()
  File "/home/administrator/slave/workspace/AAAAAA/env/lib/python3.5/site-packages/_pytest/terminal.py", line 497, in _report_keyboardinterrupt
    self.write_sep("!", msg)
  File "/home/administrator/slave/workspace/AAAAAA/env/lib/python3.5/site-packages/_pytest/terminal.py", line 226, in write_sep
    self._tw.sep(sep, title, **markup)
  File "/home/administrator/slave/workspace/AAAAAA/env/lib/python3.5/site-packages/py/_io/terminalwriter.py", line 211, in sep
    self.line(line, **kw)
  File "/home/administrator/slave/workspace/AAAAAA/env/lib/python3.5/site-packages/py/_io/terminalwriter.py", line 234, in line
    self.write(s, **kw)
  File "/home/administrator/slave/workspace/AAAAAA/env/lib/python3.5/site-packages/py/_io/terminalwriter.py", line 224, in write
    write_out(self._file, markupmsg)
  File "/home/administrator/slave/workspace/AAAAAA/env/lib/python3.5/site-packages/py/_io/terminalwriter.py", line 384, in write_out
    fil.flush()
BlockingIOError: [Errno 11] write could not complete without blocking
                                                       14      4      2      0    62%
src/xxxxxxxx/signals.py                                                                                      3      0      0      0   100%
src/xxxxxxxxx/tests/__init__.py                                                                               0      0      0      0   100%
src/xxxxxxxxx/tests/test_branch.py                                             

@codingjoe
Copy link
Contributor Author

@x007007007 I don't remember ¯_(ツ)_/¯ But reading my comment, I guess I just updated to the latest version of pytest. Sorry I can't be of more help.

@x007007007
Copy link

@codingjoe Sorry I don't have clear description my question, I'm run at newest pytest(3.4.2). and I try to switch different version all of them didn't work. I think this issue resolve my question travis-ci/travis-ci#4704.
Hope it helps

@zed
Copy link

zed commented Aug 10, 2022

I've seen the same BlockingIOError on pytest 7.1.2 (the latest).

@sindhujit1
Copy link

I have seen this happening sometimes with uwsgi in django.

@codingjoe
Copy link
Contributor Author

I have seen this happening sometimes with uwsgi in django.

I am curious, is any uwsgi code actually executed in your test suite? That seems rather unlikely to me, in most uses cases people wouldn't spin up a WSGI server during a test run.

@codingjoe
Copy link
Contributor Author

I've seen the same BlockingIOError on pytest 7.1.2 (the latest).

What OS or CI provider are you using?

@sindhujit1
Copy link

sindhujit1 commented Oct 25, 2022

@codingjoe For my stuff, uwsgi is used in our prod environment. We use django runsrever in our test environment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug problem that needs to be addressed type: question general question, might be closed after 2 weeks of inactivity
Projects
None yet
Development

No branches or pull requests

5 participants