Skip to content
Snippets Groups Projects
  1. Dec 16, 2020
    • Artem Starshov's avatar
      luacheck: change global vars to local in sql-tap · b1a4fed6
      Artem Starshov authored
      Fixed luacheck warning 111 (setting non-standard global variable)
      in test/sql-tap directory.
      Enabled this directory for checking W111 in
      config file(.luacheckrc).
      
      Changed almost all variables in test/sql-tap from globals
      to locals. In any cases, where variables need to be global,
      added explicit _G. prefix (table of globals).
      
      Fixes #5173
      Part-of #5464
      b1a4fed6
    • Artem Starshov's avatar
      bitset: replace zero-length array with flexible-array member · 9b0278f4
      Artem Starshov authored
      Zero-lenght arrays are GNU C extension.
      There's ISO C99 flexible array member, which
      is preffered mechanism to declare variable-length types.
      
      Flexible array member allows us to avoid applying sizeof
      operator cause it's incomplete type, so it will be an error
      at compile time. There're any moments else why it's better
      way to implement such structures via FAM:
      https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html
      
      In this issue it fixed gcc 10 warning:
      "warning: writing 1 byte into
      a region of size 0 [-Wstringop-overflow=]"
      
      Closes #4966
      Closes #5564
      9b0278f4
    • Artem Starshov's avatar
      sql: fix build with GCC 10 · a65d9c50
      Artem Starshov authored
      GCC 10 produces the following error:
      cc1: warning: function may return address of local variable [-Wreturn-local-addr]
      
      Fix it.
      
      Part-of #4966
      a65d9c50
  2. Dec 11, 2020
    • Serge Petrenko's avatar
      box: refactor tuple_field_raw to omit path checks · 28f3b2f1
      Serge Petrenko authored
      tuple_field_raw is an alias to tuple_field_raw_by_path with zero path.
      This involves multiple path != NULL checks which aren't needed for tuple
      field access by field number. The checks make this function rather slow
      compared to its 1.10 counterpart (see results below).
      
      In order to fix perf problems when JSON path indices aren't involved,
      factor out the part of tuple_field_raw_by_path which is responsible for
      direct field access by number and place it in tuple_field_raw.
      
      This patch was tested by snapshot recovery part involving secondary
      index building for a 1.5G snapshot with
      one space and one secondary index over 4 integer and one string field.
      Comparison table is below:
      
          Version    | time(seconds)  | Change relative to 1.10
      ---------------|----------------|------------------------
      1.10           |      2:24      |           -/-
      2.x(unpatched) |      3:03      |          + 27%
      2.x (patched)  |      2:10      |          - 10%
      
      Numbers below show cumulative time spent in tuple_compare_slowpath,
      for 1.10 / 2.x(unpatched) / 2.x(patched) for 15, 19 and 14 second
      profiles respectively: 13.9 / 17.8 / 12.5.
      
      tuple_field_raw() isn't measured directly, since it's inlined, but all
      its uses come from tuple_compare_slowpath.
      
      As the results show, we manage to be even faster, than 1.10 used to be
      in this test. This must be due to tuple comparison hints, which are
      present only in 2.x.
      
      Closes #4774
      28f3b2f1
    • Serge Petrenko's avatar
      box: speed up tuple_field_map_create · 420bacb2
      Serge Petrenko authored
      Since the introduction of JSON path indices tuple_init_field_map, which
      was quite a simple routine traversing a tuple and storing its field data
      offsets in the field map, was renamed to tuple_field_map_create and
      optimised for working with JSON path indices.
      
      The main difference is that tuple format fields are now organised in a
      tree rather than an array, and the tuple itself may have indexed fields,
      which are not plain array members, but rather members of some sub-array
      or map. This requires more complex iteration over tuple format fields
      and additional tuple parsing.
      
      All the changes were, however, unneeded for tuple formats not supporting
      fields indexed by JSON paths.
      
      Rework tuple_field_map_create so that it doesn't go through all the
      unnecessary JSON path-related checks for simple cases and restore most
      of the lost performance.
      
      Below are some benchmark results for the same workload that pointed to
      the degradation initially.
      Snapshot recovery time on RelWithDebInfo build for a 1.5G snapshot
      containing a single memtx space with one secondary index over 4 integer
      and 1 string field:
      
              Version            | Time (s) | Difference relative to 1.10
      ---------------------------|----------|----------------------------
      1.10 (the golden standard) |    28    |             -/-
      2.x (degradation)          |    39    |            + 39%
      2.x (patched)              |    31    |            + 11%
      
      Profile shows that the main difference is in memtx_tuple_new due to
      tuple_init_field_map/tuple_field_map_create performance difference.
      
      Numbers below show cumulative time spent in tuple_init_field_map (1.10) /
      tuple_field_map_create (unpatched) / tuple_field_map_create (patched).
      2.44 s / 8.61 s / 3.19 s
      
      More benchmark results can be seen at #4774
      
      Part of #4774
      420bacb2
    • Mergen Imeev's avatar
      sql: remove unecessary execute of space_cache_find() · bc16e5df
      Mergen Imeev authored
      Due to the fact that space_cache_find () is called unnecessarily, it is
      possible to set diag "Space '0' does not exist", although in this case
      it is not a wrong situation when the space id is 0.
      
      Part of #5592
      bc16e5df
    • Ilya Kosarev's avatar
      core: introduce evenly distributed int64 random in range · 31bf9ef1
      Ilya Kosarev authored
      Tarantool codebase had at least two functions to generate random
      integer in given range and both of them had problems at least with
      integer overflow. This patch brings nice functions to generate random
      int64_t in given range without overflow while preserving uniform random
      generator distribution using unbiased bitmask with rejection method.
      It is now possible to use xoshiro256++ PRNG or random bytes as a basis.
      Most relevant replacements have been made. Needed tests are introduced.
      
      Closes #5075
      31bf9ef1
    • Alexander V. Tikhonov's avatar
      test: add filter to box/net.*after_gh-3164 test · e519954a
      Alexander V. Tikhonov authored
      Found issue:
      
        [079] @@ -115,5 +115,14 @@
        [079]  -- connection is deleted by 'collect'.
        [079]  weak.c
        [079]  ---
        [079] -- null
        [079] +- peer_uuid: 035d7b36-f205-45f4-9e16-e5b0b99a9b0b
        [079] +  opts:
        [079] +    reconnect_after: 0.1
        [079] +  host: unix/
        [079] +  schema_version: 78
        [079] +  protocol: Binary
        [079] +  state: error_reconnect
        [079] +  error: Connection refused
        [079] +  peer_version_id: 132864
        [079] +  port: /tmp/tnt/079_box/proxy.socket-iproto
        [079]  ...
      
      Which could not be restarted with checksum because of changing UUID
      value each run. To avoid of it added filter on 'peer_uuid:' output.
      e519954a
    • Alexander V. Tikhonov's avatar
      test: add test filter for vinyl/errinj.test.lua · 718cba1b
      Alexander V. Tikhonov authored
      Added test-run filter on box.snapshot error message:
      
        'Invalid VYLOG file: Slice [0-9]+ deleted but not registered'
      
      to avoid of printing changing data in results file to be able to use
      its checksums in fragile list of test-run to rerun it as flaky issue.
      
      Needed for #4346
      718cba1b
  3. Dec 10, 2020
  4. Dec 08, 2020
  5. Dec 07, 2020
    • Oleg Babin's avatar
      uuid: support uuid comparison with strings · e27745ad
      Oleg Babin authored
      Before this patch it was impossible to compare uuid values with
      string representations of uuid. However we have cases when such
      comparisons is possible (e.g. "decimal" where we can compare
      decimal values with strings and numbers).
      
      This patch extends uuid comparators (__eq, __lt and __le) and
      every string argument is tried to be converted to uuid value to
      compare then.
      
      Follow-up #5511
      
      @TarantoolBot document
      Title: uuid comparison rules
      
      Currently comparison between uuid values is supported.
      
      Example:
      ```lua
      u1 = uuid.fromstr('aaaaaaaa-aaaa-4000-b000-000000000001')
      u2 = uuid.fromstr('bbbbbbbb-bbbb-4000-b000-000000000001')
      
      u1 > u2  -- false
      u1 >= u2 -- false
      u1 <= u2 -- true
      u1 < u2  -- true
      ```
      
      Also it's possible to compare uuid values with its string
      representations:
      ```lua
      u1_str = 'aaaaaaaa-aaaa-4000-b000-000000000001'
      u1 = uuid.fromstr(u1_str)
      u2_str = 'bbbbbbbb-bbbb-4000-b000-000000000001'
      
      u1 == u1_str -- true
      u1 == u2_str -- false
      
      u1 >= u1_str -- true
      u1 < u2_str  -- true
      ```
      e27745ad
    • Oleg Babin's avatar
      uuid: support comparison of uuid values in Lua · 5495d8f7
      Oleg Babin authored
      Since Tarantool has uuid data type sometimes we want to compare
      uuid values as it's possible for primitive types and decimals. This
      patch exports function for uuid comparison and implements __le and
      __lt metamethods for uuid type.
      
      Closes #5511
      5495d8f7
    • Kirill Yukhin's avatar
      luajit: bump new version · c4c626fa
      Kirill Yukhin authored
      * x64: Fix __call metamethod return dispatch.
      c4c626fa
  6. Dec 06, 2020
    • Alexander V. Tikhonov's avatar
      test: move .tarantoolctl to test-run submodule · 54667f6f
      Alexander V. Tikhonov authored
      In the previous commit the .tarantoolctl configuration file was placed
      into the test-run submodule repository as:
      
        <tarantool repository>/test-run/.tarantoolctl
      
      This commit removes it from the tarantool repository. In fact, it
      unblocks the `./test-run.py --replication-sync-timeout <seconds>` option
      and now all tests will actually receive test-run's value for the
      box.cfg() option (100 seconds by default instead of 300 seconds, which
      is tarantool's default).
      
      Updated tests with replication_sync_timeout check value. Set it to
      hidden value due to it could be set the other than default in options
      at test-run run command.
      
      Found that no need to copy tarantoolctl configuration file to binary
      path any more, after it was moved to test-run repository, so reverting
      changes from:
      
        aa609de2 ('cmake for tests updated:
        copy ctl config in builddir')
      
      Needed for #5504
      Unverified
      54667f6f
    • Alexander Turenko's avatar
      test: update test-run (--replication-sync-timeout) · 6c8efa84
      Alexander Turenko authored
      See commits in the PR [1] for detailed description of the changes. User
      visible changes are the following.
      
      1. Now test-run.py can be invoked from any directory without changing a
         current working directory to `test/`.
      2. The `test/.tarantoolctl` configuration file is not mandatory and can
         be removed. It is shipped now within the test-run repository.
      3. test-run sets the `replication_sync_timeout` box.cfg() option when
         the `test/.tarantoolctl` is not present in a parent repository. The
         value is controlled by the --replication-sync-timeout argument and
         defaults to 100 seconds (unlike tarantool's default, which is 300
         seconds).
      
      The reason of the changes is to set default `replication_sync_timeout`
      for all tests to a value lower than `--no-output-timeout` (120 seconds)
      to allow instances to step into the orphan mode before this deadline and
      see more descriptive picture when it leads to failure of a test. What is
      also important, when a test fails before the `--no-output-timeout`, we
      able to restart it based on the `fragile` suite.ini option and / or
      collect artifacts to store them in CI.
      
      The `--no-output-timeout` deadline remains the show-stopper. We'll
      introduce a test execution timeout later to step into the general
      `--no-output-timeout` only in quite rare and unusual cases.
      
      The next commit will actually remove `test/.tarantoolctl`, so the new
      `replication_sync_timeout` will be in effect.
      
      [1]: https://github.com/tarantool/test-run/pull/242
      
      Part of #5504
      Unverified
      6c8efa84
  7. Dec 04, 2020
    • Vladislav Shpilevoy's avatar
      fakesys: move fakeev to fakesys library · ac48b2ad
      Vladislav Shpilevoy authored
      Fakesys is a collection of fake implementations of deep system
      things such as libev and libc.
      
      The fake subsystems will provide API just like their original
      counterparts (except for function names), but with full control of
      their behaviour in user-space for the sake of unit testing.
      
      Fakeev is a bogus version of libev, whose main feature is virtual
      time. Fakeev has internal clock, which is fully controllable in
      user-space. That allows to roll hours of tests in milliseconds of
      real time.
      
      Fakeev is used in SWIM tests, and will be used in Raft tests.
      
      Part of #5303
      ac48b2ad
    • Vladislav Shpilevoy's avatar
      test: factor out swim from fakeev.h/.c files · 5cf45266
      Vladislav Shpilevoy authored
      SWIM unit tests contain a special library for emulating the event
      loop: swim_test_ev. It provides API similar to libev, but
      implemented entirely in user-space, including clock functions.
      
      The latter is the most important point, as the original libev
      does not allow to define your own timing functions - internally it
      relies on select/kqueue/epoll/poll/select/... with true clock.
      
      Because of that it is impossible to perform long tests with the
      original libev, which could last for minutes or even tens of
      seconds if their count is big. swim_test_ev uses virtual time,
      where hours can be played in milliseconds.
      
      --
      
      This commit extracts all swim code to swim_test_ev.c. Now this
      file is nothing but an implementation of swim_ev.h on top of
      fakeev API.
      
      Fakeev, in turn, does not depend on SWIM anymore, and can be moved
      to fakesys library.
      
      Part of #5303
      5cf45266
    • Vladislav Shpilevoy's avatar
      test: move fake libev code to fakeev.c/.h files · 6d9ac21c
      Vladislav Shpilevoy authored
      SWIM unit tests contain a special library for emulating the event
      loop: swim_test_ev. It provides API similar to libev, but
      implemented entirely in user-space, including clock functions.
      
      The latter is the most important point, as the original libev
      does not allow to define your own timing functions - internally it
      relies on select/kqueue/epoll/poll/select/... with true clock.
      
      Because of that it is impossible to perform long tests with the
      original libev, which could last for minutes or even tens of
      seconds if their count is big. swim_test_ev uses virtual time,
      where hours can be played in milliseconds.
      
      The fake libev is going to be re-used for Raft unit tests. But for
      that it is necessary to detach it from all SWIM dependencies.
      
      --
      
      The patch renames swim_test_ev.c/.h to fakeev.c/.h because they
      will contain only fakeev functions soon.
      
      The swim methods, implementing swim_ev.h via fakeev, are moved to
      their own file in a separate commit. Because their file will be
      swim_test_ev.c. If they would be moved here, git would treat it
      like everything *except* swim functions was moved to fakeev.h/.c.
      It would ruin git history, and is split in 2 commits to avoid
      this.
      
      Part of #5303
      6d9ac21c
    • Vladislav Shpilevoy's avatar
      test: rename fake libev methods to fakeev · ee09dc7b
      Vladislav Shpilevoy authored
      SWIM unit tests contain a special library for emulating the event
      loop: swim_test_ev. It provides API similar to libev, but
      implemented entirely in user-space, including clock functions.
      
      The latter is the most important point, as the original libev
      does not allow to define your own timing functions - internally it
      relies on select/kqueue/epoll/poll/select/... with true clock.
      
      Because of that it is impossible to perform long tests with the
      original libev, which could last for minutes or even tens of
      seconds if their count is big. swim_test_ev uses virtual time,
      where hours can be played in milliseconds.
      
      The fake libev is going to be re-used for Raft unit tests. But for
      that it is necessary to detach it from all SWIM dependencies.
      
      --
      
      This commit makes all swim_test_ev functions have 'fakeev' prefix
      instead of 'swim'. The functions, implementing swim_ev.h API, are
      kept as one-line proxies to the fakeev functions.
      
      Part of #5303
      ee09dc7b
    • Vladislav Shpilevoy's avatar
      fakesys: introduce fake system library · 4321b64f
      Vladislav Shpilevoy authored
      Fakesys is going to be a collection of fake implementations of
      deep system things such as libev and libc.
      
      The fake subsystems will provide API just like their original
      counterparts (except for function names), but with full control of
      their behaviour in user-space for the sake of unit testing.
      
      This commit introduces first part of fakesys - a subset of libc
      network API: sendto(), recvfrom(), bind(), close(), getifaddrs().
      
      Main features of fakenet are:
      
      - Integration with event loop via fakenet_loop_update(). Although
        this could be also considered an issue if it will be ever
        necessary to implement fake epoll, or sockets not bound to any
        event loop;
      
      - Filters to decide which packets to drop depending on their src,
        dst, and content;
      
      - Socket block to suspend packets delivery until the socket is
        unblocked.
      
      Fakenet implements connection-less API, for UDP sockets. This is
      exactly what is needed in SWIM.
      
      Raft fake transport will need reliable sockets with broadcast API.
      Reliability can be ensured by setting drop rate to 0 (which is
      default). Broadcast functionality is already present - there is a
      broadcast interface in fakenet_getifaddrs() result.
      
      Part of #5303
      4321b64f
    • Vladislav Shpilevoy's avatar
      test: factor out swim from fakenet.c/.h files · e463b454
      Vladislav Shpilevoy authored
      SWIM unit tests contain special libraries for emulating event loop
      and network: swim_test_ev and swim_test_transport. They provide
      API similar to libev and to network part of libc, which internally
      is implemented entirely in user-space and allows to simulate all
      kinds of errors, any time durations, etc.
      
      These test libraries are going to be re-used for Raft unit tests.
      But for that it is necessary to detach them from all SWIM
      dependencies.
      
      --
      
      This commit extracts all swim code to swim_test_transport.c. Now
      this file is nothing but an implementation of swim_transport.h on
      top of fakenet API.
      
      Fakenet, in turn, does not depend on SWIM anymore, and can be
      moved to its own library.
      
      Part of #5303
      e463b454
    • Vladislav Shpilevoy's avatar
      test: move fake network code to fakenet.c/.h files · e224c909
      Vladislav Shpilevoy authored
      SWIM unit tests contain special libraries for emulating event loop
      and network: swim_test_ev and swim_test_transport. They provide
      API similar to libev and to network part of libc, which internally
      is implemented entirely in user-space and allows to simulate all
      kinds of errors, any time durations, etc.
      
      These test libraries are going to be re-used for Raft unit tests.
      But for that it is necessary to detach them from all SWIM
      dependencies.
      
      --
      
      This commit moves all fake network code to separate files -
      fakenet.c/.h, which are now easy to relocate to a new library.
      
      These files still contain some swim methods, which are moved to
      their own file in a separate commit. Because their file will be
      swim_test_transport.c. But if they would be moved there in the
      same commit, git would treat it like everything *except* the swim
      methods was moved to fakenet.c/.h because of names clash. That
      would destroy git history. So the swim code movement is split in 2
      commits.
      
      Part of #5303
      e224c909
    • Vladislav Shpilevoy's avatar
      test: rename fake libc network methods to fakenet · bdaa1013
      Vladislav Shpilevoy authored
      SWIM unit tests contain special libraries for emulating event loop
      and network: swim_test_ev and swim_test_transport. They provide
      API similar to libev and to network part of libc, which internally
      is implemented entirely in user-space and allows to simulate all
      kinds of errors, any time durations, etc.
      
      These test libraries are going to be re-used for Raft unit tests.
      But for that it is necessary to detach them from all SWIM
      dependencies.
      
      --
      
      The only dependency left in fake network functions is the 'swim'
      prefix. This commit replaces it with 'fakenet' before they are
      going to be moved to their own library.
      
      Part of #5303
      bdaa1013
    • Vladislav Shpilevoy's avatar
      test: factor out swim from libc emulation funcs · cb75dcf4
      Vladislav Shpilevoy authored
      SWIM unit tests contain special libraries for emulating event loop
      and network: swim_test_ev and swim_test_transport. They provide
      API similar to libev and to network part of libc, which internally
      is implemented entirely in user-space and allows to simulate all
      kinds of errors, any time durations, etc.
      
      These test libraries are going to be re-used for Raft unit tests.
      But for that it is necessary to detach them from all SWIM
      dependencies.
      
      --
      
      This commit extracts libc-like functions from the fake
      implementation of swim_transport.h functions.
      
      That allows to move swim functions out of the fake network
      library to their own file, and build the fake network as an
      independent library not related to swim.
      
      It is worth mentioning that the bind() emulator (swim_test_bind())
      is not a true bind(). Its behaviour is more like socket() +
      bind() + close(). Such API was designed for swim_transport, and
      it seems too hard to split it into separate methods, especially
      socket() and bind().
      
      Because in the fake network library there is a relation between
      IPv4 address and file descriptor number. It means, you can't
      create a file descriptor without occupying an address. So
      socket() + bind() and rebind (= close() + socket() + bind()) must
      be atomic. swim_test_bind() does that. This will also work fine
      for Raft, so it was left as is for now.
      
      Part of #5303
      cb75dcf4
    • Vladislav Shpilevoy's avatar
      test: stop using swim_transport.addr as in-param · 7e23ca79
      Vladislav Shpilevoy authored
      SWIM unit tests contain special libraries for emulating event loop
      and network: swim_test_ev and swim_test_transport. They provide
      API similar to libev and to network part of libc, which internally
      is implemented entirely in user-space and allows to simulate all
      kinds of errors, any time durations, etc.
      
      These test libraries are going to be re-used for Raft unit tests.
      But for that it is necessary to detach them from all SWIM
      dependencies.
      
      --
      
      One of the dependencies - swim_transport.addr, which was used in
      swim_transport_send() as an input parameter. swim_transport_send()
      simulates sendto(), and it can't be generalized while it depends
      on source address being passed explicitly.
      
      This patch makes swim_transport_send() deduct the source address
      by the file descriptor number.
      
      There is a couple of new functions for that:
      swim_test_sockaddr_in_to_fd and swim_test_fd_to_sockaddr_in.
      
      They were inlined earlier, but it seems the fd <-> source address
      translation is used often enough to extract these functions.
      
      Part of #5303
      7e23ca79
    • Alexander V. Tikhonov's avatar
      test: replication-py/init_storage.test.py · 362c195c
      Alexander V. Tikhonov authored
      Found that test failed in 2 common places when it tried to start the
      replica and wait it within 'JOIN' either 'SUBSCRIBE' test parts.
      It used to wait for replica start check the 'wait_until_started()'
      function 'TarantoolServer' class from test-run repository. But it
      didn't try resolve connection issues on replica creation, like:
      
        [30534] main/103/replica I> connecting to 1 replicas
        [30534] main/112/applier/localhost:49168 I> can't connect to master
        [30534] main/112/applier/localhost:49168 sio.c:208 !> SystemError connect to 127.0.0.1:49168, called on fd 27, aka 127.0.0.1:47954: Connection refused
        [30534] main/112/applier/localhost:49168 I> will retry every 0.10 second
        [30534] main/112/applier/localhost:49168 I> remote master c5d480c3-219c-11eb-ac14-080027727614 at 127.0.0.1:49168 running Tarantool 2.7.0
        [30534] main/103/replica I> connected to 1 replicas
        [30534] main/103/replica I> bootstrapping replica from c5d480c3-219c-11eb-ac14-080027727614 at 127.0.0.1:49168
        [30534] main/112/applier/localhost:49168 I> can't read row
        [30534] main/112/applier/localhost:49168 box.cc:183 E> ER_READONLY: Can't modify data because this instance is in read-only mode.
        [30534] main/103/replica box.cc:183 E> ER_READONLY: Can't modify data because this instance is in read-only mode.
        [30534] main/103/replica F> can't initialize storage: Can't modify data because this instance is in read-only mode.
        [30534] main/103/replica F> can't initialize storage: Can't modify data because this instance is in read-only mode.
      
      To resolve it the test was changed to be able to catch exception
      'TarantoolStartError' from test-run. Also the test should have the
      ability to be restarted by test-run using fragile list and in this way
      'crash_expected' flag was enabled to let the test fail with exception.
      
      Needed by #4949
      362c195c
    • Alexander V. Tikhonov's avatar
      test: flaky hang vinyl/ddl.test.lua test · 565b29b6
      Alexander V. Tikhonov authored
      Found hanging test vinyl/ddl.test.lua on:
      
        [159]  inspector:wait_cond(function() return box.space.test.index.pk:count() == box.space.test.index.tk:count() end)
        [159]  ---
        [159]  - true
        [159]  ...
        [159] -box.snapshot()
        [159] ----
        [159] -- ok
        [159] -...
      
      The real issue happend before it when test failed on:
      
        [091] --- engine/ddl.result   Thu May 14 16:12:09 2020
        [091] +++ engine/ddl.reject   Fri May 15 04:15:07 2020
        [091] @@ -2558,7 +2558,7 @@
        [091]  ...
        [091]  inspector:wait_cond(function() return box.space.test.index.pk:count() == box.space.test.index.sk:count() end)
        [091]  ---
        [091] -- true
        [091] +- false
        [091]  ...
      
      Our tests have structure when different standalone subtests exists
      in the test files. To be able to check all of them this hang must
      be neutralized to give the next standalone subtest ability to pass.
      To avoid of this hang decided to disable box.snapshot check if the
      previous check of the current subtest failed.
      
      Needed for #4353
      565b29b6
    • Alexander V. Tikhonov's avatar
      Revert "Fix flaky test engine/ddl" · ec8a021d
      Alexander V. Tikhonov authored
      Found that the previous fix of the engine/ddl.test.lua test committed
      with:
      
        5f96ee59 ('Fix flaky test engine/ddl')
      
      did not fix the issue #4353 in real and it was reverted.
      
      Needed for #4353
      ec8a021d
    • Alexander Turenko's avatar
      test: update test-run (SIGKILL for hang tarantool) · 24f57a35
      Alexander Turenko authored
      Limit waiting for a tarantool process termination by 5 seconds. When
      this timeout exceeded, print a warning to the terminal and send SIGKILL
      to the process.
      
      We need to handle the situation with a stuck tarantool process on the
      testing system side to overcome a problem of this kind that appears on
      Mac OS (see #5573).
      
      This changeset handles one particular case: stopping of a tarantool
      instance that either started for execution of a 'core = tarantool' test
      suite or started from a test using the `test_run:cmd('start server
      foo')` command. It does not handle stopping of tarantool that is started
      for execution of a 'core = app' test or started from a test directly
      using io.popen() or built-in 'popen' module.
      
      Related to #5573
      Part of https://github.com/tarantool/test-run/issues/157
      The changeset: https://github.com/tarantool/test-run/pull/186
      Unverified
      24f57a35
    • Alexander Turenko's avatar
      test: update test-run (handle no result file) · e9579d54
      Alexander Turenko authored
      This changeset fixes a problem that unlikely will hit anyone, but in
      theory it may be triggered by an incorrect behaviour of tarantool.
      
      In brief, if tarantool does not react to SIGTERM after executing all
      tests and a test-run's worker stucks at waiting for termination of the
      tarantool process, the test-run's listener would fail at attempt to
      access a temporary result file that does not exists. See more details in
      [1].
      
      [1]: https://github.com/tarantool/test-run/issues/245
      Unverified
      e9579d54
    • Alexander Turenko's avatar
      test: update test-run (--snapshot) · af0e365e
      Alexander Turenko authored
      * Added --snapshot and --disable-schema-upgrade arguments (#240).
      * Fixed reporting of an error for conflicting arguments (#241).
      
      The `--snapshot path/to/snapshot` argument copies a given snapshot to a
      snapshot directory before start a tarantool instance. This allows to
      verify various functionality in the case, when tarantool is upgraded
      from a snapshot that is left by an older tarantool version (as opposite
      to test it on a freshly bootstrapped instance). There are limitations:
      when a test spawns a replica set, the option does not work correctly.
      The reason is that the same instance UUIDs (and IDs) cannot be used by
      different instances in a replica set. Maybe there are other pitfalls.
      
      The `--disable-schema-upgrade` argument instructs tarantool to skip
      execution of the schema upgrade script (using ERRINJ_AUTO_UPGRADE). This
      way we can verify that, when an instance works on an old schema version,
      a functionality is workable or at least gives correct error message.
      
      This commit only brings the new options into test-run. It does NOT add
      any new testing targets / rules.
      
      Part of #4801
      Unverified
      af0e365e
  8. Dec 03, 2020
  9. Dec 02, 2020
    • Sergey Ostanevich's avatar
      fiber: handle fiber cancellation for fiber.cond · bd03dfc7
      Sergey Ostanevich authored
      
      Before this patch fiber.cond():wait() just returns for cancelled
      fiber. In contrast fiber.channel():get() throws "fiber is canceled"
      error. This patch unifies behaviour of channels and condvars.
      It also fixes a related net.box module problem #4834 since fiber.cond
      now performs test for fiber cancellation.
      
      Closes #4834
      Closes #5013
      
      Co-authored-by: default avatarOleg Babin <olegrok@tarantool.org>
      
      @TarantoolBot document
      Title: fiber.cond():wait() throws if fiber is cancelled
      
      Currently fiber.cond():wait() throws an error if waiting fiber is
      cancelled.
      bd03dfc7
    • Sergey Ostanevich's avatar
      relay: preparation for fiber:cond to throw · 7f5eda79
      Sergey Ostanevich authored
      The fiber_cond_wait() will set an error in case fiber is cancelled.
      As a result, the current diag in the fiber can be reset during
      the wal_clear_watcher(). To prevent such overwrite the diag copy from
      the relay into current fiber is moved to the exit of the
      relay_subscribe_f().
      
      Part of #5013
      7f5eda79
Loading