[PATCH] D73707: [TSAN] Parameterize the hard-coded threshold of deflake in tsan test
Hubert Tong via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jan 31 07:59:47 PST 2020
hubert.reinterpretcast added inline comments.
================
Comment at: compiler-rt/test/tsan/deflake.bash:13
-for i in $(seq 1 10); do
+THRESHOLD=${1}
+shift
----------------
Please add quotes around variable expansion here and for further expansions of `THRESHOLD`.
================
Comment at: compiler-rt/test/tsan/deflake.bash:16
+
+#Early exit if $THRESHOLD is not a non-negative integer
+[[ ! ${THRESHOLD} =~ ^[0-9]+$ ]] && exit 1
----------------
Minor nit: It seems that the usual style uses a space after `#`?
================
Comment at: compiler-rt/test/tsan/deflake.bash:17
+#Early exit if $THRESHOLD is not a non-negative integer
+[[ ! ${THRESHOLD} =~ ^[0-9]+$ ]] && exit 1
+
----------------
Suggest to use `||` instead of using `!` with `&&`.
================
Comment at: compiler-rt/test/tsan/deflake.bash:19
+
+for i in $(seq 1 ${THRESHOLD}); do
OUT=`$@ 2>&1`
----------------
This can be
```
while (( THRESHOLD-- )); do
```
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D73707/new/
https://reviews.llvm.org/D73707
More information about the llvm-commits
mailing list