5

I'm testing my Django app using LiveServerTestCase with Django version 1.4, Python 2.7, python bindings for selenium 2.53.1, Firefox 45.0.1 on Linux.

I've been getting this broken pipe error similar to this question. I've watched the webdriver and have narrowed it down to occur seemingly when WebDriver ends too quickly before the page (which has some ajax components) have fully loaded.

1) This occurs even when I run just one of my tests so it doesn't have to do with pipes breaking between tests.
2) For all button clicks that load a different page, I have added an explicit wait for the particular ajax component that doesn't seem to be loading 3) Also added an overall page_load_timeout of 30 seconds.

Even after all this still I get this error intermittently and am at my wits end, any suggestions?

Traceback (most recent call last):
  File "/usr/lib/python2.7/wsgiref/handlers.py", line 86, in run
    self.finish_response()
  File "/usr/lib/python2.7/wsgiref/handlers.py", line 128, in finish_response
    self.write(data)
  File "/usr/lib/python2.7/wsgiref/handlers.py", line 212, in write
    self.send_headers()
  File "/usr/lib/python2.7/wsgiref/handlers.py", line 270, in send_headers
    self.send_preamble()
  File "/usr/lib/python2.7/wsgiref/handlers.py", line 194, in send_preamble
    'Date: %s\r\n' % format_date_time(time.time())
  File "/usr/lib/python2.7/socket.py", line 324, in write
    self.flush()
  File "/usr/lib/python2.7/socket.py", line 303, in flush
    self._sock.sendall(view[write_offset:write_offset+buffer_size])
error: [Errno 32] Broken pipe
----------------------------------------
Exception happened during processing of request from ('127.0.0.1', 41308)
Traceback (most recent call last):
  File "/home/jw/.virtualenvs/istame1.4/local/lib/python2.7/site-packages/django/test/testcases.py", line 981, in _handle_request_noblock
    self.process_request(request, client_address)
  File "/usr/lib/python2.7/SocketServer.py", line 321, in process_request
    self.finish_request(request, client_address)
  File "/usr/lib/python2.7/SocketServer.py", line 334, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/home/jw/.virtualenvs/istame1.4/local/lib/python2.7/site-packages/django/core/servers/basehttp.py", line 139, in __init__
    super(WSGIRequestHandler, self).__init__(*args, **kwargs)
  File "/usr/lib/python2.7/SocketServer.py", line 651, in __init__
    self.finish()
  File "/usr/lib/python2.7/SocketServer.py", line 710, in finish
    self.wfile.close()
  File "/usr/lib/python2.7/socket.py", line 279, in close
    self.flush()
  File "/usr/lib/python2.7/socket.py", line 303, in flush
    self._sock.sendall(view[write_offset:write_offset+buffer_size])
error: [Errno 32] Broken pipe
Moshe Slavin
  • 5,127
  • 5
  • 23
  • 38
ishikun
  • 428
  • 5
  • 21

0 Answers0