Skip to content

Commit

Permalink
Enable TSAN builds on CI (#7797)
Browse files Browse the repository at this point in the history
* Enable TSAN builds on CI for Functional Tests.

This enables TSAN checking when running the functional tests in CI.

This is currently only enabled on Linux since the various races there
were fixed when #7478 landed.

When Darwin races are fixed, tsan can be enabled for those too.

* Fix-ups as per review feedback, including enabling it for Darwin

* Increased timeout for tsan jobs since it takes some time!

* Increased timeout for tsan jobs since it takes some time (real fix)!
  • Loading branch information
mrjerryjohns authored and pull[bot] committed Jun 25, 2021
1 parent 5269ef9 commit 1265456
Showing 1 changed file with 45 additions and 13 deletions.
58 changes: 45 additions & 13 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ jobs:
name: Test Suites - Linux
timeout-minutes: 60

strategy:
matrix:
type: [debug, tsan]

if: github.actor != 'restyled-io[bot]'
runs-on: ubuntu-latest

Expand All @@ -54,48 +58,64 @@ jobs:
uses: actions/upload-artifact@v2
if: ${{ always() }}
with:
name: bootstrap-logs
name: bootstrap-logs-${{ matrix.type }}
path: |
.environment/gn_out/.ninja_log
.environment/pigweed-venv/*.log
- name: Build all clusters app
timeout-minutes: 5
run: |
scripts/examples/gn_build_example.sh examples/all-clusters-app/linux out/debug/standalone/ chip_config_network_layer_ble=false
case ${{ matrix.type }} in
"debug") GN_ARGS='is_tsan=false';;
"tsan") GN_ARGS='is_tsan=true';;
*) ;;
esac
scripts/examples/gn_build_example.sh examples/all-clusters-app/linux out/debug/standalone/ chip_config_network_layer_ble=false "$GN_ARGS"
- name: Build chip-tool
timeout-minutes: 5
run: |
scripts/examples/gn_build_example.sh examples/chip-tool out/debug/standalone/
case ${{ matrix.type }} in
"debug") GN_ARGS='is_tsan=false';;
"tsan") GN_ARGS='is_tsan=true';;
*) ;;
esac
scripts/examples/gn_build_example.sh examples/chip-tool out/debug/standalone/ "$GN_ARGS"
- name: Copy objdir
run: |
# The idea is to not upload our objdir unless builds have
# actually succeeded, because that just wastes space.
rsync -a out/debug/standalone/ objdir-clone || true
- name: Run Tests
timeout-minutes: 5
timeout-minutes: 10
run: |
ifconfig -a
scripts/tests/test_suites.sh
- name: Uploading core files
uses: actions/upload-artifact@v2
if: ${{ failure() }}
with:
name: crash-core-linux
name: crash-core-linux-${{ matrix.type }}
path: /tmp/cores/
# Cores are big; don't hold on to them too long.
retention-days: 5
- name: Uploading objdir for debugging
uses: actions/upload-artifact@v2
if: ${{ failure() }}
with:
name: crash-objdir-linux
name: crash-objdir-linux-${{ matrix.type }}
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: 60

strategy:
matrix:
type: [debug, tsan]

if: github.actor != 'restyled-io[bot]'
runs-on: macos-latest

Expand Down Expand Up @@ -127,46 +147,58 @@ jobs:
uses: actions/upload-artifact@v2
if: ${{ always() }}
with:
name: bootstrap-logs
name: bootstrap-logs-${{ matrix.type }}
path: |
.environment/gn_out/.ninja_log
.environment/pigweed-venv/*.log
- name: Run Build Test Server
timeout-minutes: 5
run: |
scripts/examples/gn_build_example.sh examples/all-clusters-app/linux out/debug/standalone/ chip_config_network_layer_ble=false
case ${{ matrix.type }} in
"debug") GN_ARGS='is_tsan=false';;
"tsan") GN_ARGS='is_tsan=true';;
*) ;;
esac
scripts/examples/gn_build_example.sh examples/all-clusters-app/linux out/debug/standalone/ chip_config_network_layer_ble=false "$GN_ARGS"
- name: Build chip-tool
timeout-minutes: 5
run: |
scripts/examples/gn_build_example.sh examples/chip-tool out/debug/standalone/
case ${{ matrix.type }} in
"debug") GN_ARGS='is_tsan=false';;
"tsan") GN_ARGS='is_tsan=true';;
*) ;;
esac
scripts/examples/gn_build_example.sh examples/chip-tool out/debug/standalone/ "$GN_ARGS"
- name: Copy objdir
run: |
# The idea is to not upload our objdir unless builds have
# actually succeeded, because that just wastes space.
rsync -a out/debug/standalone/ objdir-clone || true
- name: Run Test Suites
timeout-minutes: 5
timeout-minutes: 10
run: |
scripts/tests/test_suites.sh
- name: Uploading core files
uses: actions/upload-artifact@v2
if: ${{ failure() }}
with:
name: crash-core-darwin
name: crash-core-darwin-${{ matrix.type }}
path: /cores/
# Cores are big; don't hold on to them too long.
retention-days: 5
- name: Uploading diagnostic logs
uses: actions/upload-artifact@v2
if: ${{ failure() }}
with:
name: crash-log-darwin
name: crash-log-darwin-${{ matrix.type }}
path: ~/Library/Logs/DiagnosticReports/
- name: Uploading objdir for debugging
uses: actions/upload-artifact@v2
if: ${{ failure() }}
with:
name: crash-objdir-darwin
name: crash-objdir-darwin-${{ matrix.type }}
path: objdir-clone/
# objdirs are big; don't hold on to them too long.
retention-days: 5

0 comments on commit 1265456

Please sign in to comment.