From 3a7d271be322c8313a78e2cd899c962c220f783e Mon Sep 17 00:00:00 2001 From: Arkadiusz Bokowy Date: Mon, 7 Nov 2022 15:54:47 +0100 Subject: [PATCH] Run Linux TSAN tests with TSAN-enabled glib-2.0 libs --- .github/workflows/tests.yaml | 83 +++++++++++++++---- .../chiptest/tsan-linux-suppressions.txt | 10 --- 2 files changed, 66 insertions(+), 27 deletions(-) delete mode 100644 scripts/tests/chiptest/tsan-linux-suppressions.txt diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index c2337ef74af2a0..90d37425923972 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -37,7 +37,7 @@ jobs: env: BUILD_VARIANT: ${{matrix.build_variant}} CHIP_TOOL_VARIANT: ${{matrix.chip_tool}} - TSAN_OPTIONS: "halt_on_error=1 suppressions=scripts/tests/chiptest/tsan-linux-suppressions.txt" + TSAN_OPTIONS: halt_on_error=1 LSAN_OPTIONS: detect_leaks=1 if: github.actor != 'restyled-io[bot]' @@ -196,6 +196,7 @@ jobs: - name: Run Tests timeout-minutes: 65 run: | + test -z ${BUILD_VARIANT##*tsan*} && export LD_LIBRARY_PATH=$LD_LIBRARY_PATH_TSAN ./scripts/run_in_build_env.sh \ "./scripts/tests/run_test_suite.py \ --chip-tool ./out/linux-x64-chip-tool${CHIP_TOOL_VARIANT}-${BUILD_VARIANT}/chip-tool \ @@ -225,6 +226,7 @@ jobs: path: objdir-clone/ # objdirs are big; don't hold on to them too long. retention-days: 5 + test_suites_darwin: name: Test Suites - Darwin timeout-minutes: 150 @@ -236,7 +238,7 @@ jobs: env: BUILD_VARIANT: ${{matrix.build_variant}} CHIP_TOOL_VARIANT: ${{matrix.chip_tool}} - TSAN_OPTIONS: "halt_on_error=1" + TSAN_OPTIONS: halt_on_error=1 LSAN_OPTIONS: detect_leaks=1 suppressions=scripts/tests/chiptest/lsan-mac-suppressions.txt if: github.actor != 'restyled-io[bot]' @@ -336,12 +338,19 @@ jobs: path: objdir-clone/ # objdirs are big; don't hold on to them too long. retention-days: 5 + repl_tests_linux: name: REPL Tests - Linux timeout-minutes: 130 + strategy: + matrix: + build_variant: [ipv6only-no-ble-no-wifi-tsan-clang] + chip_tool: [""] env: - TSAN_OPTIONS: "halt_on_error=1 suppressions=scripts/tests/chiptest/tsan-linux-suppressions.txt" + BUILD_VARIANT: ${{ matrix.build_variant }} + CHIP_TOOL_VARIANT: ${{ matrix.chip_tool }} + TSAN_OPTIONS: halt_on_error=1 if: github.actor != 'restyled-io[bot]' runs-on: ubuntu-latest @@ -376,22 +385,56 @@ jobs: - name: Build Python REPL and example apps timeout-minutes: 50 run: | - scripts/run_in_build_env.sh './scripts/build_python.sh --install_wheel build-env' + ./scripts/run_in_build_env.sh './scripts/build_python.sh --install_wheel build-env' ./scripts/run_in_build_env.sh \ - "./scripts/build/build_examples.py \ - --target linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test \ - --target linux-x64-python-bindings \ - build \ - --copy-artifacts-to objdir-clone \ - " + "./scripts/build/build_examples.py \ + --target linux-x64-all-${BUILD_VARIANT}-test \ + --target linux-x64-python-bindings \ + build \ + --copy-artifacts-to objdir-clone \ + " - name: Run Tests timeout-minutes: 10 run: | - scripts/run_in_build_env.sh './scripts/tests/run_python_test.py --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app --factoryreset --script-args "--log-level INFO -t 3600 --disable-test ClusterObjectTests.TestTimedRequestTimeout"' - scripts/run_in_build_env.sh './scripts/tests/run_python_test.py --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app --factoryreset --app-args "--discriminator 1234 --KVS kvs1 --trace_decode 1" --script "src/python_testing/TC_RR_1_1.py" --script-args "--storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021"' - scripts/run_in_build_env.sh './scripts/tests/run_python_test.py --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app --factoryreset --app-args "--discriminator 1234 --KVS kvs1 --trace_decode 1" --script "src/python_testing/TC_SC_3_6.py" --script-args "--storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021"' - scripts/run_in_build_env.sh './scripts/tests/run_python_test.py --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app --factoryreset --app-args "--discriminator 1234 --KVS kvs1 --trace_decode 1" --script "src/python_testing/TC_DA_1_7.py" --script-args "--storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --bool-arg allow_sdk_dac:true"' - scripts/run_in_build_env.sh './scripts/tests/run_python_test.py --app out/linux-x64-all-clusters-ipv6only-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app --factoryreset --app-args "--discriminator 1234 --KVS kvs1 --trace_decode 1 --enable-key 000102030405060708090a0b0c0d0e0f" --script "src/python_testing/TC_TestEventTrigger.py" --script-args "--storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --bool-arg allow_sdk_dac:true"' + test -z ${BUILD_VARIANT##*tsan*} && export LD_LIBRARY_PATH=$LD_LIBRARY_PATH_TSAN + ./scripts/run_in_build_env.sh \ + "./scripts/tests/run_python_test.py \ + --app out/linux-x64-all-clusters-${BUILD_VARIANT}-test/chip-all-clusters-app \ + --factoryreset \ + --script-args '--log-level INFO -t 3600 --disable-test ClusterObjectTests.TestTimedRequestTimeout' \ + " + ./scripts/run_in_build_env.sh \ + "./scripts/tests/run_python_test.py \ + --app out/linux-x64-all-clusters-${BUILD_VARIANT}-test/chip-all-clusters-app \ + --factoryreset \ + --app-args '--discriminator 1234 --KVS kvs1 --trace_decode 1' \ + --script 'src/python_testing/TC_RR_1_1.py' \ + --script-args '--storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021' \ + " + ./scripts/run_in_build_env.sh \ + "./scripts/tests/run_python_test.py \ + --app out/linux-x64-all-clusters-${BUILD_VARIANT}-test/chip-all-clusters-app\ + --factoryreset \ + --app-args '--discriminator 1234 --KVS kvs1 --trace_decode 1' \ + --script 'src/python_testing/TC_SC_3_6.py' \ + --script-args '--storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021' \ + " + ./scripts/run_in_build_env.sh \ + "./scripts/tests/run_python_test.py \ + --app out/linux-x64-all-clusters-${BUILD_VARIANT}-test/chip-all-clusters-app \ + --factoryreset \ + --app-args '--discriminator 1234 --KVS kvs1 --trace_decode 1' \ + --script 'src/python_testing/TC_DA_1_7.py' \ + --script-args '--storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --bool-arg allow_sdk_dac:true' \ + " + ./scripts/run_in_build_env.sh \ + "./scripts/tests/run_python_test.py \ + --app out/linux-x64-all-clusters-${BUILD_VARIANT}-test/chip-all-clusters-app \ + --factoryreset \ + --app-args '--discriminator 1234 --KVS kvs1 --trace_decode 1 --enable-key 000102030405060708090a0b0c0d0e0f' \ + --script 'src/python_testing/TC_TestEventTrigger.py' \ + --script-args '--storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --bool-arg allow_sdk_dac:true' \ + " - name: Uploading core files uses: actions/upload-artifact@v3 if: ${{ failure() && !env.ACT }} @@ -460,7 +503,7 @@ jobs: - name: Build Python REPL and example apps timeout-minutes: 50 run: | - scripts/run_in_build_env.sh './scripts/build_python.sh --install_wheel build-env' + ./scripts/run_in_build_env.sh './scripts/build_python.sh --install_wheel build-env' ./scripts/run_in_build_env.sh \ "./scripts/build/build_examples.py \ --target darwin-x64-all-clusters-${BUILD_VARIANT}-test \ @@ -470,7 +513,13 @@ jobs: - name: Run Tests timeout-minutes: 30 run: | - scripts/run_in_build_env.sh './scripts/tests/run_python_test.py --app out/darwin-x64-all-clusters-no-ble-no-wifi-tsan-clang-test/chip-all-clusters-app --factoryreset --app-args "--discriminator 3840 --interface-id -1" --script-args "-t 3600 --disable-test ClusterObjectTests.TestTimedRequestTimeout"' + ./scripts/run_in_build_env.sh \ + "./scripts/tests/run_python_test.py \ + --app out/darwin-x64-all-clusters-${BUILD_VARIANT}-test/chip-all-clusters-app \ + --factoryreset \ + --app-args '--discriminator 3840 --interface-id -1' \ + --script-args '-t 3600 --disable-test ClusterObjectTests.TestTimedRequestTimeout' \ + " - name: Uploading core files uses: actions/upload-artifact@v3 if: ${{ failure() && !env.ACT }} diff --git a/scripts/tests/chiptest/tsan-linux-suppressions.txt b/scripts/tests/chiptest/tsan-linux-suppressions.txt deleted file mode 100644 index e5f8cec28d51ee..00000000000000 --- a/scripts/tests/chiptest/tsan-linux-suppressions.txt +++ /dev/null @@ -1,10 +0,0 @@ -# The Linux server app ends up with a data race in libglib. A race_top -# suppression does not work, since the actual race is inside a memset, so the -# thing on top of the stack is memset. called_from_lib is a narrower -# suppression than a "race" suppression (which would be "libglib anywhere on the -# stack", as opposed to "inside a function TSan intercepts, which was called -# from libglib). -# -# See https://github.com/project-chip/connectedhomeip/issues/14710 for -# addressing this. -called_from_lib:libglib