Skip to content

Commit

Permalink
Add thread sanitizer to test (#72)
Browse files Browse the repository at this point in the history
  • Loading branch information
NobodyXu authored Dec 20, 2021
1 parent f06b051 commit d82b9e1
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -213,3 +213,36 @@ jobs:
PROPTEST_CASES: "10"
MIRIFLAGS: "-Zmiri-disable-isolation"
run: cargo miri test --all-features

thread_sanitizer-MacOS:
name: Thread Sanitizer checks MacOS
runs-on: macos-latest

steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ github.event.repository.name }}-${{ runner.os }}-cargo-thread_sanitizer-v2
- name: Install latest nightly
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true
components: rust-src
- name: Run thread sanitizer
run: |
# Thread sanitizer isn't guaranteed to catch all data races, it can only catch it
# the data race if it happens when running the program.
#
# Running the tests multiple times increase the chances that data races are found
# by the thread sanitizer.
for _ in $(seq 1 10); do cargo +nightly test -Z build-std --target --target $(uname -m)-apple-darwin; done
env:
RUSTDOCFLAGS: "-Zsanitizer=thread"
RUSTFLAGS: "-Zsanitizer=thread"

1 comment on commit d82b9e1

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Track benchmarks

Benchmark suite Current: d82b9e1 Previous: f06b051 Ratio
uncontended/load 20 ns/iter (± 1) 24 ns/iter (± 1) 0.83
uncontended/load_full 34 ns/iter (± 1) 42 ns/iter (± 3) 0.81
uncontended/load_many 44 ns/iter (± 1) 60 ns/iter (± 3) 0.73
uncontended/store 141 ns/iter (± 5) 163 ns/iter (± 14) 0.87
uncontended/cache 0 ns/iter (± 0) 0 ns/iter (± 0) NaN
concurrent_loads/load 29 ns/iter (± 11) 43 ns/iter (± 14) 0.67
concurrent_loads/load_full 48 ns/iter (± 19) 53 ns/iter (± 20) 0.91
concurrent_loads/load_many 54 ns/iter (± 38) 69 ns/iter (± 28) 0.78
concurrent_loads/store 1057 ns/iter (± 363) 1051 ns/iter (± 410) 1.01
concurrent_loads/cache 1 ns/iter (± 0) 1 ns/iter (± 0) 1
concurrent_store/load 77 ns/iter (± 7) 94 ns/iter (± 17) 0.82
concurrent_store/load_full 115 ns/iter (± 7) 121 ns/iter (± 14) 0.95
concurrent_store/load_many 146 ns/iter (± 9) 164 ns/iter (± 23) 0.89
concurrent_store/store 1067 ns/iter (± 44) 1273 ns/iter (± 175) 0.84
concurrent_store/cache 1 ns/iter (± 0) 1 ns/iter (± 0) 1

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.