commit - 1979cd076b62cdccbce56c94154d2664045322ce
commit + b771bb05bedde7053beb7ad7f3853d5fb81753ba
blob - 4618125c98f180bfe3c5bd4be5612fb18b924a5b
blob + 1be366ff584cdb570190109595263451f331cb90
--- test/tarantool/bank_client.lua
+++ test/tarantool/bank_client.lua
-- Molly client with read and transfer operations for bank test.
-local checks = require('checks')
local math = require('math')
local net_box = require('net.box')
local cl = client.new()
cl.open = function(self, addr)
- checks('table', 'string')
-
rawset(self, 'addr', addr)
local conn = net_box.connect(self.addr)
if conn:ping() ~= true then
end
cl.setup = function(self)
- checks('table')
-
if self.conn:ping() ~= true then
error(string.format('No connection to %s', self.addr))
end
end
cl.invoke = function(self, op)
- checks('table', {
- f = 'string',
- v = '?',
- process = '?number',
- time = '?number',
- })
-
if self.conn:ping() ~= true then
error(string.format('No connection to %s', self.addr))
end
end
cl.teardown = function(self)
- checks('table')
-
if self.conn:ping() ~= true then
error(string.format('No connection to %s', self.addr))
end
end
cl.close = function(self)
- checks('table')
-
if self.conn:ping() == true then
self.conn:close()
end
blob - b24f4cf76cd2ba1ff09be9b8e678b40accac8814
blob + a6088cb7099fe48226da2358c23a99c6fd0f3904
--- test/tarantool/cas_register_client.lua
+++ test/tarantool/cas_register_client.lua
-- Molly client with read, write and CAS operations.
-local dev_checks = require('checks')
local math = require('math')
local net_box = require('net.box')
local molly = require('molly')
local cl = client.new()
cl.open = function(self, addr)
- dev_checks('table', 'string')
-
rawset(self, 'addr', addr)
local conn = net_box.connect(addr)
if conn:ping() ~= true then
end
cl.setup = function(self)
- dev_checks('table')
-
if self.conn:ping() ~= true then
error(string.format('No connection to %s', self.addr))
end
cl.invoke = function(self, op)
-- TODO: try async mode in net_box module
-- https://www.tarantool.io/en/doc/latest/reference/reference_lua/net_box/#lua-function.conn.request
- dev_checks('table', {
- f = 'string',
- v = '?',
- process = '?number',
- time = '?number',
- })
-
if self.conn:ping() ~= true then
error(string.format('No connection to %s', self.addr))
end
end
cl.teardown = function(self)
- dev_checks('table')
-
if self.conn:ping() ~= true then
error(string.format('No connection to %s', self.addr))
end
end
cl.close = function(self)
- dev_checks('table')
-
if self.conn:ping() == true then
self.conn:close()
end