Skip to content
Snippets Groups Projects
Commit efb68b46 authored by Konstantin Osipov's avatar Konstantin Osipov
Browse files

Merge remote-tracking branch 'origin/master' into lua-plus-dict

parents 8476d3c8 e4fdac06
No related branches found
No related tags found
No related merge requests found
......@@ -231,9 +231,27 @@ ssize_t
sio_read(int fd, void *buf, size_t count)
{
ssize_t n = read(fd, buf, count);
if (n < 0 && errno != EAGAIN &&
errno != EWOULDBLOCK && errno != EINTR)
if (n < 0) {
if (errno == EWOULDBLOCK)
errno = EINTR;
switch (errno) {
case EAGAIN:
case EINTR:
break;
/*
* Happens typically when the client closes
* socket on timeout without reading the previous
* query's response completely. Treat the same as
* EOF.
*/
case ECONNRESET:
errno = 0;
n = 0;
break;
default:
tnt_raise(SocketError, fd, "read(%zd)", count);
}
}
return n;
}
......
......@@ -436,7 +436,7 @@ class TarantoolServer(Server):
time.sleep(0.001)
is_connected = False
while not is_connected:
while not is_connected and not self.gdb:
try:
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.connect(("localhost", self.port))
......@@ -447,16 +447,10 @@ class TarantoolServer(Server):
def wait_until_stopped(self):
"""Wait until the server is stoped and has closed sockets"""
while self.read_pidfile() != -1:
time.sleep(0.001)
is_connected = False
while not is_connected:
while True:
try:
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.connect(("localhost", self.port))
is_connected = True
sock.close()
time.sleep(0.001)
continue
......@@ -465,21 +459,12 @@ class TarantoolServer(Server):
def find_tests(self, test_suite, suite_path):
def patterned(test, patterns):
answer = []
for i in patterns:
if test.name.find(i) != -1:
return True
return False
for test_name in sorted(glob.glob(os.path.join(suite_path, "*.test.py"))):
for test_pattern in test_suite.args.tests:
if test_name.find(test_pattern) != -1:
test_suite.tests.append(PythonTest(test_name, test_suite.args, test_suite.ini))
for test_name in sorted(glob.glob(os.path.join(suite_path, "*.test.lua"))):
for test_pattern in test_suite.args.tests:
if test_name.find(test_pattern) != -1:
test_suite.tests.append(LuaTest(test_name, test_suite.args, test_suite.ini))
# tests = [PythonTest(k, test_suite.args, test_suite.ini) for k in sorted(glob.glob(os.path.join(suite_path, "*.test.py" )))]
# tests += [LuaTest(k, test_suite.args, test_suite.ini) for k in sorted(glob.glob(os.path.join(suite_path, "*.test.lua")))]
# test_suite.tests = filter((lambda x: patterned(x, test_suite.args.tests)), tests)
answer.append(test)
return answer
tests = [PythonTest(k, test_suite.args, test_suite.ini) for k in sorted(glob.glob(os.path.join(suite_path, "*.test.py" )))]
tests += [LuaTest(k, test_suite.args, test_suite.ini) for k in sorted(glob.glob(os.path.join(suite_path, "*.test.lua")))]
test_suite.tests = sum(map((lambda x: patterned(x, test_suite.args.tests)), tests), [])
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment