[test] Deflake test/profile/ContinuousSyncMode/online-merging.c
authorVedant Kumar <vsk@apple.com>
Thu, 2 Jul 2020 20:28:48 +0000 (13:28 -0700)
committerVedant Kumar <vsk@apple.com>
Thu, 2 Jul 2020 20:31:56 +0000 (13:31 -0700)
commit47481cbffbefb399e672cf056c15323917bf43bf
tree92852e64ece0369cdf90886f723af9028af001b9
parent359345d609043543e6480954c535d8d5074a5a94
[test] Deflake test/profile/ContinuousSyncMode/online-merging.c

This test spawns 32 child processes which race to update counters on
shared memory pages. On some Apple-internal machines, two processes race
to perform an update in approximately 0.5% of the test runs, leading to
dropped counter updates. Deflake the test by using atomic increments.

Tested with:

```
$ for I in $(seq 1 1000); do echo ":: Test run $I..."; ./bin/llvm-lit projects/compiler-rt/test/profile/Profile-x86_64h/ContinuousSyncMode/online-merging.c -av || break; done
```

rdar://64956774
compiler-rt/test/profile/ContinuousSyncMode/online-merging.c