You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The patch is a bit dirty: tasks to rerun are added after 'stop worker'
marker, so old worker is stopped and the new one is spawned to handle
those tasks. See new FIXME comment for more information.
How to verify:
| # Ensure a test is marked as fragile.
| $ grep tarantoolctl.test.lua test/app-tap/suite.ini
| fragile = tarantoolctl.test.lua ; gh-5059
|
| # Let the test fail randomly.
| $ git diff
| --- a/test/app-tap/tarantoolctl.test.lua
| +++ b/test/app-tap/tarantoolctl.test.lua
| @@ -643,4 +643,24 @@ test:test('filter_xlog', function(test)
| end
| end)
|
| -os.exit(test:check() == true and 0 or -1)
| +local function string_to_unsigned(str)
| + local byte_list = {string.byte(str, 1, #str)}
| + local res = 0
| + for i = 1, #byte_list do
| + res = bit.lshift(res, 8)
| + res = bit.bor(res, byte_list[i])
| + end
| + -- fix bitop's numbers range: signed 32-bit to unsigned 32-bit
| + -- http://bitop.luajit.org/semantics.html
| + res = (res < 0) and -res + 0x7fffffff or res
| + return res
| +end
| +
| +local RND_SEED_LEN = 4
| +local fh = require('fio').open('/dev/urandom', {'O_RDONLY'})
| +local seed_raw = fh:read(RND_SEED_LEN)
| +fh:close()
| +local seed = string_to_unsigned(seed_raw)
| +math.randomseed(seed)
| +
| +os.exit(test:check() == true and math.random(0, 1) or 1)
|
| # Run several times to observe actual behaviour.
| $ (cd test && ./test-run.py app-tap/tarantoolctl.test.lua)
Part of tarantool/tarantool#5050
0 commit comments