diff --git a/src/sio.cc b/src/sio.cc index 9f79f972956133d6f01c6ada0a040ee9db93e898..f76c53b08fb5b6e29c280030ef4442b688c03be6 100644 --- a/src/sio.cc +++ b/src/sio.cc @@ -214,7 +214,7 @@ sio_connect(int fd, struct sockaddr *addr, socklen_t addrlen) /* Establish the connection. */ int rc = connect(fd, (struct sockaddr *) addr, addrlen); if (rc < 0 && errno != EINPROGRESS) { - tnt_raise(SocketError, fd, "connect"); + tnt_raise(SocketError, fd, "connect to %s", sio_strfaddr((struct sockaddr *)addr, addrlen)); } return rc; } diff --git a/test/box/transaction.result b/test/box/transaction.result index e80b2c7e3a3e72da2df03e640e1840b45285077c..2de70ddff4036bc98bfa20b8dfc3a71f319c565f 100644 --- a/test/box/transaction.result +++ b/test/box/transaction.result @@ -47,19 +47,8 @@ f = fiber.create(sloppy); ... -- when the sloppy fiber ends, its session has an active transction -- ensure it's rolled back automatically -f:status(); +while f:status() ~= 'dead' do fiber.sleep(0) end; --- -- dead -... -fiber.sleep(0); ---- -... -fiber.sleep(0); ---- -... -f:status(); ---- -- dead ... -- transactions and system spaces box.begin() box.schema.space.create('test'); @@ -205,14 +194,14 @@ box.commit(); box.begin() s:insert{1, 'Must be rolled back'}; --- ... +-- nothing - the transaction was rolled back -- nothing to commit because of yield +while s:get{1} ~= nil do fiber.sleep(0) end box.commit(); --- ... --- nothing - the transaction was rolled back -- Test background fiber -- -s:select{} function sloppy() box.begin() s:insert{1, 'From background fiber'} @@ -233,6 +222,9 @@ s:select{}; --- - [] ... +t = nil; +--- +... function sloppy() box.begin() s:insert{1, 'From background fiber'} @@ -245,7 +237,7 @@ end; f = fiber.create(sloppy); --- ... -while f:status() == 'running' do +while f:status() ~= 'dead' do fiber.sleep(0) end; --- @@ -395,3 +387,6 @@ box.space.test:len() --- - 10001 ... +box.space.test:drop() +--- +... diff --git a/test/box/transaction.test.lua b/test/box/transaction.test.lua index bb02ccf48d3b5116e5bf2770dca65ff1bece74b8..d03f78cb2cc56e5ff4f5073a9022b8c221e45bb1 100644 --- a/test/box/transaction.test.lua +++ b/test/box/transaction.test.lua @@ -24,10 +24,7 @@ end; f = fiber.create(sloppy); -- when the sloppy fiber ends, its session has an active transction -- ensure it's rolled back automatically -f:status(); -fiber.sleep(0); -fiber.sleep(0); -f:status(); +while f:status() ~= 'dead' do fiber.sleep(0) end; -- transactions and system spaces box.begin() box.schema.space.create('test'); box.rollback(); @@ -90,10 +87,10 @@ box.begin(); -- back a transction with no statements. box.commit(); box.begin() s:insert{1, 'Must be rolled back'}; +-- nothing - the transaction was rolled back +while s:get{1} ~= nil do fiber.sleep(0) end -- nothing to commit because of yield box.commit(); --- nothing - the transaction was rolled back -s:select{} -- Test background fiber -- function sloppy() @@ -107,6 +104,7 @@ end; -- When the sloppy fiber ends, its session has an active transction -- It's rolled back automatically s:select{}; +t = nil; function sloppy() box.begin() s:insert{1, 'From background fiber'} @@ -115,7 +113,7 @@ function sloppy() t = s:select{} end; f = fiber.create(sloppy); -while f:status() == 'running' do +while f:status() ~= 'dead' do fiber.sleep(0) end; t; @@ -186,3 +184,4 @@ _ = box.schema.space.create('test'); _ = box.space.test:create_index('primary'); tx_limit(10000) box.space.test:len() +box.space.test:drop()