Top.Mail.Ru
Module luatest.helpers | Tarantool
 
Reference / Rocks reference / Luatest / Module luatest.helpers
Reference / Rocks reference / Luatest / Module luatest.helpers

Module luatest.helpers

Module luatest.helpers

Collection of test helpers.

Methods

Keep calling fn until it returns without error. Throws last error if config.timeout is elapsed. Default options are taken from helpers.RETRYING_TIMEOUT and helpers.RETRYING_DELAY.

helpers.retrying({}, fn, arg1, arg2)
helpers.retrying({timeout = 2, delay = 0.5}, fn, arg1, arg2)

Parameters:

  • config:
    • timeout: (number)
    • delay: (number)
  • fn: (func)
  • …: args

Generates uuids from its 5 parts. Strings are repeated and numbers are padded to match required part length. If number of arguments is less than 5 then first and last arguments are used for corresponding parts, missing parts are set to 0.

'aaaaaaaa-0000-0000-0000-000000000000' == uuid('a')
'abababab-0000-0000-0000-000000000001' == uuid('ab', 1)
'00000001-0002-0000-0000-000000000003' == uuid(1, 2, 3)
'11111111-2222-0000-0000-333333333333' == uuid('1', '2', '3')
'12121212-3434-5656-7878-909090909090' == uuid('12', '34', '56', '78', '90')

Parameters:

  • a: first part
  • …: parts