Skip to content

prevent intermittent broken_pipe errors with threaded=True #56

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

Merged

Conversation

mattwbarry
Copy link
Contributor

Running my tests I am getting frequent but intermittent broken pipe errors when accessing various app endpoints. I was able to solve this locally by adding threaded=True to app.run invocation here

@vitalk
Copy link
Collaborator

vitalk commented Dec 19, 2016

Nice catch up, @mattwbarry! This errors mainly occur when your app trying to handle concurrent requests, for example

@app.route('/one')
def one():
    res = requests.get(url_for('two', _external=True))
    return res.text

@app.route('/two')
def two():
    return '42'

def test_should_fail(self, live_server):
    res = urlopen(url_for('one', _external=True))
    assert b'42' in res.read()
@vitalk vitalk merged commit d8e9c97 into pytest-dev:master Dec 19, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants