From 5c93f81881019c76170ecb3ee34d95c0b12686cf Mon Sep 17 00:00:00 2001 From: antonio2368 Date: Fri, 2 Apr 2021 12:29:10 +0200 Subject: [PATCH] Disable failing tests and add logs for replication e2e (#132) * Disable sequential test * Remove parent build and benchmark * Save test data * Save e2e logs in build folder * Define different recovery time for each test --- .github/workflows/diff.yaml | 58 ++++------------------ tests/e2e/memory/workloads.yaml | 3 +- tests/e2e/replication/workloads.yaml | 12 +++-- tests/e2e/runner.py | 4 +- tests/jepsen/src/jepsen/memgraph/bank.clj | 2 +- tests/jepsen/src/jepsen/memgraph/core.clj | 6 +-- tests/jepsen/src/jepsen/memgraph/large.clj | 2 +- 7 files changed, 27 insertions(+), 60 deletions(-) diff --git a/.github/workflows/diff.yaml b/.github/workflows/diff.yaml index 4ba546412..502052f94 100644 --- a/.github/workflows/diff.yaml +++ b/.github/workflows/diff.yaml @@ -217,21 +217,6 @@ jobs: # branches and tags. (default: 1) fetch-depth: 0 - - name: Set up parent - run: | - # Remove parent folder (if it exists). - cd .. - if [ -d parent ]; then - rm -rf parent - fi - - # Copy untouched repository to parent folder. - cp -r memgraph parent - - # Checkout previous commit - cd parent - git checkout HEAD~1 - - name: Build release binaries run: | # Activate toolchain. @@ -245,20 +230,6 @@ jobs: cmake -DCMAKE_BUILD_TYPE=release .. make -j$THREADS - - name: Build parent binaries - run: | - # Activate toolchain. - source /opt/toolchain-v2/activate - - # Initialize dependencies. - cd ../parent - ./init - - # Build parent binaries. - cd build - cmake -DCMAKE_BUILD_TYPE=release .. - make -j$THREADS memgraph memgraph__macro_benchmark - - name: Run macro benchmark tests run: | cd tests/macro_benchmark @@ -266,26 +237,6 @@ jobs: --groups aggregation 1000_create unwind_create dense_expand match \ --no-strict - - name: Run parent macro benchmark tests - run: | - cd ../parent/tests/macro_benchmark - ./harness QuerySuite MemgraphRunner \ - --groups aggregation 1000_create unwind_create dense_expand match \ - --no-strict - - - name: Compute macro benchmark summary - run: | - ./tools/github/macro_benchmark_summary \ - --current tests/macro_benchmark/.harness_summary \ - --previous ../parent/tests/macro_benchmark/.harness_summary \ - --output macro_benchmark_summary.txt - - - name: Save macro benchmark summary - uses: actions/upload-artifact@v2 - with: - name: "Macro benchmark summary" - path: macro_benchmark_summary.txt - - name: Run GQL Behave tests run: | cd tests/gql_behave @@ -348,6 +299,15 @@ jobs: name: "Enterprise DEB package" path: build/output/memgraph*.deb + - name: Save test data + uses: actions/upload-artifact@v2 + if: always() + with: + name: "Test data" + path: | + # multiple paths could be defined + build/logs + release_jepsen_test: name: "Release Jepsen Test" runs-on: [self-hosted, Linux, X64, Debian10, JepsenControl] diff --git a/tests/e2e/memory/workloads.yaml b/tests/e2e/memory/workloads.yaml index 147b87b04..74dc59e1a 100644 --- a/tests/e2e/memory/workloads.yaml +++ b/tests/e2e/memory/workloads.yaml @@ -2,7 +2,8 @@ bolt_port: &bolt_port "7687" template_cluster: &template_cluster cluster: main: - args: ["--bolt-port", *bolt_port, "--memory-limit=500", "--storage-gc-cycle-sec=180"] + args: ["--bolt-port", *bolt_port, "--memory-limit=500", "--storage-gc-cycle-sec=180", "--log-level=TRACE"] + log_file: "memory-e2e.log" setup_queries: [] validation_queries: [] diff --git a/tests/e2e/replication/workloads.yaml b/tests/e2e/replication/workloads.yaml index 5f5a0d65d..39e1c9bdf 100644 --- a/tests/e2e/replication/workloads.yaml +++ b/tests/e2e/replication/workloads.yaml @@ -11,19 +11,23 @@ template_validation_queries: &template_validation_queries template_cluster: &template_cluster cluster: replica_1: - args: ["--bolt-port", "7688"] + args: ["--bolt-port", "7688", "--log-level=TRACE"] + log_file: "replication-e2e-replica1.log" setup_queries: ["SET REPLICATION ROLE TO REPLICA WITH PORT 10001;"] <<: *template_validation_queries replica_2: - args: ["--bolt-port", "7689"] + args: ["--bolt-port", "7689", "--log-level=TRACE"] + log_file: "replication-e2e-replica2.log" setup_queries: ["SET REPLICATION ROLE TO REPLICA WITH PORT 10002;"] <<: *template_validation_queries replica_3: - args: ["--bolt-port", "7690"] + args: ["--bolt-port", "7690", "--log-level=TRACE"] + log_file: "replication-e2e-replica3.log" setup_queries: ["SET REPLICATION ROLE TO REPLICA WITH PORT 10003;"] <<: *template_validation_queries main: - args: ["--bolt-port", "7687"] + args: ["--bolt-port", "7687", "--log-level=TRACE"] + log_file: "replication-e2e-main.log" setup_queries: [ "REGISTER REPLICA replica_1 SYNC WITH TIMEOUT 0 TO '127.0.0.1:10001'", "REGISTER REPLICA replica_2 SYNC WITH TIMEOUT 1 TO '127.0.0.1:10002'", diff --git a/tests/e2e/runner.py b/tests/e2e/runner.py index 453c8d3de..5d88740d9 100755 --- a/tests/e2e/runner.py +++ b/tests/e2e/runner.py @@ -44,7 +44,9 @@ def run(args): for name, config in workload['cluster'].items(): mg_instance = MemgraphInstanceRunner(MEMGRAPH_BINARY) mg_instances[name] = mg_instance - mg_instance.start(args=config['args']) + log_file_path = os.path.join(BUILD_DIR, 'logs', config['log_file']) + binary_args = config['args'] + ["--log-file", log_file_path] + mg_instance.start(args=binary_args) for query in config['setup_queries']: mg_instance.query(query) # Test. diff --git a/tests/jepsen/src/jepsen/memgraph/bank.clj b/tests/jepsen/src/jepsen/memgraph/bank.clj index 9db55106a..3bfb79409 100644 --- a/tests/jepsen/src/jepsen/memgraph/bank.clj +++ b/tests/jepsen/src/jepsen/memgraph/bank.clj @@ -164,4 +164,4 @@ {:bank (bank-checker) :timeline (timeline/html)}) :generator (c/replication-gen (gen/mix [read-balances valid-transfer])) - :final-generator (gen/once read-balances)}) + :final-generator {:gen (gen/once read-balances) :recovery-time 20}}) diff --git a/tests/jepsen/src/jepsen/memgraph/core.clj b/tests/jepsen/src/jepsen/memgraph/core.clj index 69a4a0aa0..77bf6a163 100644 --- a/tests/jepsen/src/jepsen/memgraph/core.clj +++ b/tests/jepsen/src/jepsen/memgraph/core.clj @@ -22,7 +22,7 @@ "A map of workload names to functions that can take opts and construct workloads." {:bank bank/workload - :sequential sequential/workload + ;; :sequential sequential/workload (T0532-MG) :large large/workload}) (def nemesis-configuration @@ -45,8 +45,8 @@ (gen/log "Healing cluster.") (gen/nemesis (:final-generator nemesis)) (gen/log "Waiting for recovery") - (gen/sleep 20) - (gen/clients final-generator)) + (gen/sleep (:recovery-time final-generator)) + (gen/clients (:gen final-generator))) gen)] (merge tests/noop-test opts diff --git a/tests/jepsen/src/jepsen/memgraph/large.clj b/tests/jepsen/src/jepsen/memgraph/large.clj index d58248df7..cc710252a 100644 --- a/tests/jepsen/src/jepsen/memgraph/large.clj +++ b/tests/jepsen/src/jepsen/memgraph/large.clj @@ -103,4 +103,4 @@ :timeline (timeline/html)}) :generator (c/replication-gen (gen/mix [read-nodes add-nodes])) - :final-generator (gen/once read-nodes)}) + :final-generator {:gen (gen/once read-nodes) :recovery-time 40}})