prevent intermittent broken_pipe errors with threaded=True by mattwbarry · Pull Request #56 · pytest-dev/pytest-flask (original) (raw)
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 andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Conversation1 Commits1 Checks0 Files changed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
[ Show hidden characters]({{ revealButtonHref }})
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
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 added a commit that referenced this pull request
2 participants