Fix ExceptionCounter.oneThread test case
authorDmitry Pleshkov <bort@fb.com>
Wed, 19 Oct 2016 22:57:39 +0000 (15:57 -0700)
committerFacebook Github Bot <facebook-github-bot-bot@fb.com>
Wed, 19 Oct 2016 23:08:50 +0000 (16:08 -0700)
Summary: Test fails because of loop unrolling: frames are not being grouped up

Reviewed By: ot

Differential Revision: D4034910

fbshipit-source-id: 159d3a4f116f90fdd0d51ee9de38634167ed0dc4

folly/experimental/exception_tracer/test/ExceptionCounterTest.cpp

index 24b413e95d6449ab4e1912752b9cea4fb9a2da89..706177b85c21f563d4b86ba3f52fb4e32cbc31fc 100644 (file)
@@ -45,7 +45,9 @@ void throwAndCatch(F f) {
 
 TEST(ExceptionCounter, oneThread) {
   throwAndCatch(foo);
-  for (int i = 0; i < 10; ++i) {
+
+  // Use volatile to prevent loop unrolling (it screws up stack frame grouping).
+  for (volatile int i = 0; i < 10; ++i) {
     throwAndCatch(bar);
   }