IMPALA-9547: retry accept in test_shell_commandline

This is a point solution to this particular socket.accept()
call failing. The more general problem is described in
https://www.python.org/dev/peps/pep-0475/ and fixed in
Python 3.5.

Change-Id: Icc9cab98b059042855ca9149427d079951471be0
Reviewed-on: http://gerrit.cloudera.org:8080/15541
Reviewed-by: Impala Public Jenkins <impala-public-jenkins@cloudera.com>
Tested-by: Impala Public Jenkins <impala-public-jenkins@cloudera.com>
This commit is contained in:
Tim Armstrong
2020-03-23 20:36:09 -07:00
committed by Impala Public Jenkins
parent 1411ca6a00
commit 35d2718d36

View File

@@ -17,6 +17,7 @@
# specific language governing permissions and limitations
# under the License.
import errno
import os
import pytest
import re
@@ -789,7 +790,15 @@ class TestImpalaShell(ImpalaTestSuite):
try:
connection = None
impala_shell = Popen(shell_cmd + args, stdout=devnull, stderr=devnull)
connection, client_address = sock.accept()
# IMPALA-9547: retry accept(). This is required in Python < 3.5 because some
# EINTR return calls from syscalls are not automatically retried. See PEP475.
while True:
try:
connection, client_address = sock.accept()
break
except IOError, e:
if e.errno != errno.EINTR:
raise
data = connection.recv(1024)
assert expected_output in data
finally: