milvus/tests/python_client/chaos
yanliang567 b78550374b
[skip ci]Remove useless code (#7745)
Signed-off-by: yanliang567 <yanliang.qiao@zilliz.com>
2021-09-10 19:28:01 +08:00
..
chaos_objects Update chaos podkill experiment (#7732) 2021-09-10 19:06:01 +08:00
chaos_commons.py Replace sdk source and merge tests and tests20 (#7182) 2021-08-20 11:00:56 +08:00
chaos_opt.py Replace sdk source and merge tests and tests20 (#7182) 2021-08-20 11:00:56 +08:00
checker.py Replace sdk source and merge tests and tests20 (#7182) 2021-08-20 11:00:56 +08:00
constants.py [skip ci]Remove useless code (#7745) 2021-09-10 19:28:01 +08:00
README.md [skip ci]Add todo for chaos tests (#7646) 2021-09-09 17:14:13 +08:00
test_chaos_data_consist.py Replace sdk source and merge tests and tests20 (#7182) 2021-08-20 11:00:56 +08:00
test_chaos.py Update chaos podkill experiment (#7732) 2021-09-10 19:06:01 +08:00

Chaos Tests

Goal

Chaos tests are designed to check the reliability of Milvus.

For instance, if one pod is killed:

  • verify that it restarts automatically
  • verify that the related operation fails, while the other operations keep working successfully during the absence of the pod
  • verify that all the operations work successfully after the pod back to running state
  • verify that no data lost

Prerequisite

Chaos tests run in pytest framework, same as e2e tests.

Please refer to Run E2E Tests

Test Scenarios

Milvus in cluster mode

  1. root coordinator pod is killed

  2. proxy pod is killed

  3. data coordinator pod is killed

  4. data node pod is killed

  5. index coordinator pod is killed

  6. index node pod is killed

  7. query coordinator pod is killed

  8. query node pod is killed

  9. minio pod is killed

Milvus in standalone mode

  1. standalone pod is killed

  2. minio pod is killed

How it works

  • Test scenarios are designed by different chaos objects
  • Every chaos object is defined in one yaml file locates in folder chaos_objects
  • Every chaos yaml file specified by ALL_CHAOS_YAMLS in constants.py would be parsed as a parameter and be passed into test_chaos.py
  • All expectations of every scenario are defined in testcases.yaml locates in folder chaos_objects
  • Chaos Mesh is used to inject chaos into Milvus in test_chaos.py

Run

Manually

Run a single test scenario manually(take query node pod is killed as instance):

  1. update ALL_CHAOS_YAMLS = 'chaos_querynode*.yaml' in constants.py

  2. run the commands below:

cd /milvus/tests/python_client/chaos

pytest test_chaos.py --host x.x.x.x -v

Nightly

still in planning

Todo

pod_failure container_kill