Skip to content
Snippets Groups Projects
  1. May 26, 2022
  2. May 25, 2022
  3. May 24, 2022
  4. May 23, 2022
  5. May 21, 2022
    • Yaroslav Dynnikov's avatar
      refactor: employ topology module in start_boot · 33ac49d9
      Yaroslav Dynnikov authored
      It's necessary to incapsulate topology management logics away from main.
      33ac49d9
    • Yaroslav Dynnikov's avatar
      feature: topology module · 955aa02e
      Yaroslav Dynnikov authored
      It encapsulates the logics of a JoinRequest batch processing.
      
      Topology module will be quite important in picodata. This first version
      misses a lot of features, but a few commits later it's going to
      implement quite a lot of logics.
      
      When a new instance is joined - there's one complex thing: raft leader
      has to decide where this new instance is going to be emplaced, i.e. what
      replicaset should it join. There're many different parameters have an
      influence - `repliction_factor`, `failure-domain`, and of course the
      existing topology. So, this new `topology` module must make the decision.
      
      This patch only refactors the current Picodata behavior, and doesn't
      bring new features for its users. Instead, it opens the door to a future
      development.
      
      Also, this patch provides a unit-testing basis for the future features.
      955aa02e
  6. May 20, 2022
  7. May 17, 2022
    • Yaroslav Dynnikov's avatar
      fix: preserve env when running pytest · 9439cbdd
      Yaroslav Dynnikov authored
      Before this patch, pytest used to launch all instances in a clean
      environment. It prevented running with `PICODATA_LOG_LEVEL=verbose`.
      9439cbdd
    • Yaroslav Dynnikov's avatar
      chore: speedup pytest · 1da4a7e7
      Yaroslav Dynnikov authored
      Specifying the particular directory with tests
      significantly speeds up their collection and execution.
      
      Before:
      
      ```console
      $ time pytest -k nothing
      12 deselected in 1.36s
      ```
      
      After:
      
      ```
      12 deselected in 0.04s
      ```
      1da4a7e7
    • Yaroslav Dynnikov's avatar
      test: dynamic discovery · 47a6e7cb
      Yaroslav Dynnikov authored and Yaroslav Dynnikov's avatar Yaroslav Dynnikov committed
      This patch covers one more case when discovery request is handled
      by an instance that has the discovery module unitialized.
      47a6e7cb
  8. May 16, 2022
    • Yaroslav Dynnikov's avatar
      test: fix flaky args::tests · 18ccf158
      Yaroslav Dynnikov authored
      By default cargo runs tests in parallel in multiple threads.  Both
      `test_log_level` and `test_parse` access environment variables which are
      shared across threads. Consequently, their concurrent modification
      results in the test failure.
      
      This patch unites these two tests making it linear.
      18ccf158
  9. May 13, 2022
  10. May 12, 2022
  11. May 11, 2022
    • Yaroslav Dynnikov's avatar
      test: arrange pytest logging · 71d5bb1f
      Yaroslav Dynnikov authored
      1. Print logs to the stderr so that they interleave with tarantool logs.
      2. Fix `cluster.__repr__()`.
      71d5bb1f
    • Yaroslav Dynnikov's avatar
      test: revise pytest environment · 1bfc5a21
      Yaroslav Dynnikov authored
      1. Review `Pipfile`:
        - Remove unused `filelock`;
        - Install `mypy` - static type checker for Python.
      2. Add new command `pipenv run lint`.
      3. Enable `mypy` in CI. Fix reported errors in `test_basics.py`.
      4. Renew readme.
      1bfc5a21
    • Yaroslav Dynnikov's avatar
      test: almost entirely refactor pytest · 1a3b5233
      Yaroslav Dynnikov authored
      In `conftest.py`:
      
        - *Add* function `xdist_worker_number`. It converts `str(worker_id)` into `int`.
          It serves as a substitute for `session_data_mutex` for parallel test runs.
      
        - *Change* `normalize_net_box_result`. Replace a function with a decorator. Also,
          handle typical kinds of picodata responses. Extensively test it in
          `test_basics.py::test_eval/call_normalization`.
      
        - *Add* dataclass `RaftStatus`. It shouldn't be used outside `conftest.py`. It only makes
          assertions more brief in logs and understndable in code.
      
        - *Add* all raft stuff into the `Instance` class. This implies `raft_propose_eval`,
          `assert_raft_status` all `promote_or_fail` moved from `util.py`.
      
        - *Change* fixture `compile`. No need in extra logics since commit 59c31cb8.
      
        - *Preserve* fixture `binary_path`.
      
        - *Remove* fixtures `session_data_mutex` and `run_id`. Superseded with `xdist_worker_number`.
      
        - *Remove* fixtures `run_cluster` and `run_instance`. Superseded with `cluster.deploy(...)`.
      
        - *Remove* function `wait_tcp_port`. It's never enough to check raw socket. Superseded with
          `instance.wait_ready()`.
      
        - Give the instances clean names `i1, i2, ...`, and simple addresses `127.7.0.1:3301`.
          For the parallel test run use different IPs `127.7.N.1` etc.
      
      In `test_basics.py`:
      
        - *Add* `test_xdist_worker_number`.
      
        - *Add* `test_call_normalization` and `test_eval_normalization`.
      
        - *Add* `test_process_management`. It's brand new, never implemented in luatest before.
      
        - *Rename* `test_single_instance_raft_eval` to `test_propose_eval` and extend it with additional
          assertion from `single_test.lua`.
      
        - *Remove* `test_instance`. A part of its logics is moved to `test_call/eval_normalization`. The
          other part is rewritten and extended in `test_process_management`.
      
        - *Remove* `test_cluster`. It was completely useless because of inappropriate synchronization and
          no valuable assertions.
      
        - *Remove* `test_propose_eval`. It wasn't that useful, but failed because of inappropriate
          synchronization.
      
      In `test_couple.py`:
      
        - *Preserve* `test_follower_proposal` and `test_failover`. Just slightly refactor according to the
          new `conftest.py` API.
      
      In `util.py` (completely removed):
      
        - *Remove* decorator `retry`. Needless.
      
        - *Remove* decorator `retry_on_network_errors`. Inappropriate predicate didn't catch Lua errors.
      
        - *Remove* everything related to raft. Move it into `conftest.py`.
      
      Part of https://git.picodata.io/picodata/picodata/picodata/-/issues/59
      1a3b5233
  12. May 08, 2022
  13. May 06, 2022
Loading