From 1cd12e2b837c8e730e1fbe8556ebe36fd534777f Mon Sep 17 00:00:00 2001 From: zhuwenxing Date: Wed, 13 Oct 2021 19:26:34 +0800 Subject: [PATCH] [skip ci]Update pod kill chaos (#9818) Signed-off-by: zhuwenxing --- .github/workflows/pod-kill-chaos-test.yaml | 5 ++++- tests/python_client/chaos/test_chaos.py | 20 ++++++++++---------- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/.github/workflows/pod-kill-chaos-test.yaml b/.github/workflows/pod-kill-chaos-test.yaml index 5d59328b48..98f9e7a05f 100644 --- a/.github/workflows/pod-kill-chaos-test.yaml +++ b/.github/workflows/pod-kill-chaos-test.yaml @@ -66,6 +66,9 @@ jobs: sleep 20s # check whether port-forward success nc -vz 127.0.0.1 19530 + # check whether milvus server is healthy + wget https://raw.githubusercontent.com/milvus-io/pymilvus/v2.0.0rc6/examples/hello_milvus.py + python hello_milvus.py - name: Chaos Test shell: bash @@ -74,7 +77,7 @@ jobs: # replace chaos object sed -i "s/ALL_CHAOS_YAMLS =.*/ALL_CHAOS_YAMLS = \'chaos_${{ matrix.pod }}_podkill.yaml\'/g" constants.py cat constants.py - pytest -s -v test_chaos.py --host 127.0.0.1 --log-level=INFO --tb=no + pytest -s -v test_chaos.py --host 127.0.0.1 - name: Export logs if: ${{ always() }} diff --git a/tests/python_client/chaos/test_chaos.py b/tests/python_client/chaos/test_chaos.py index 46b7e2a2ef..8ff77014a2 100644 --- a/tests/python_client/chaos/test_chaos.py +++ b/tests/python_client/chaos/test_chaos.py @@ -143,16 +143,16 @@ class TestChaos(TestChaosBase): for k, t in self.checker_threads.items(): log.info(f"10s later: Thread {k} is_alive(): {t.is_alive()}") - # # assert statistic - # log.info("******2nd assert after chaos injected: ") - # assert_statistic(self.health_checkers, - # expectations={Op.create: self.expect_create, - # Op.insert: self.expect_insert, - # Op.flush: self.expect_flush, - # Op.index: self.expect_index, - # Op.search: self.expect_search, - # Op.query: self.expect_query - # }) + # assert statistic + log.info("******2nd assert after chaos injected: ") + assert_statistic(self.health_checkers, + expectations={Op.create: self.expect_create, + Op.insert: self.expect_insert, + Op.flush: self.expect_flush, + Op.index: self.expect_index, + Op.search: self.expect_search, + Op.query: self.expect_query + }) # delete chaos meta_name = chaos_config.get('metadata', None).get('name', None)