Use stress command to catch flaky tests.
For example, I’m trying to catch a panic in TestPostToCommunityChat in MessengerCommunitiesShardingSuite.
Compile the package tests into a binary
go test -c ./protocol
Run stress tests:
stress \
-count 1000 '
./protocol.test \
-test.run TestMessengerCommunitiesShardingSuite \
-testify.m TestPostToCommunityChat