This is an automated email from the ASF dual-hosted git repository.

adar pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kudu.git


The following commit(s) were added to refs/heads/master by this push:
     new 5ce3a02  KUDU-3093: fix DebugUtilTest.TestSignalStackTrace in RELEASE 
mode
5ce3a02 is described below

commit 5ce3a022f99ee3f99e086292487e390e3334d247
Author: Adar Dembo <[email protected]>
AuthorDate: Fri Mar 27 16:31:31 2020 -0700

    KUDU-3093: fix DebugUtilTest.TestSignalStackTrace in RELEASE mode
    
    I think commit f37e7a6e0 regressed this test when Kudu is built with a more
    modern compiler, due to the opportunity for more inlining.
    
    Change-Id: I0bcd76f42b70bfc77ab18e8163a367f89eaad3e9
    Reviewed-on: http://gerrit.cloudera.org:8080/15572
    Tested-by: Kudu Jenkins
    Reviewed-by: Alexey Serbin <[email protected]>
---
 src/kudu/util/debug-util-test.cc | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/src/kudu/util/debug-util-test.cc b/src/kudu/util/debug-util-test.cc
index 5175f46..2227a19 100644
--- a/src/kudu/util/debug-util-test.cc
+++ b/src/kudu/util/debug-util-test.cc
@@ -119,9 +119,14 @@ TEST_F(DebugUtilTest, TestSignalStackTrace) {
 
   // We have to loop a little bit because it takes a little while for the 
thread
   // to start up and actually call our function.
+  //
+  // Note: due to RELEASE build inlining, we need to make sure to pick a stack
+  // frame that isn't optimized away.
+  static constexpr const char* kTestThreadStackFrame =
+      "kudu::ConditionVariable::WaitUntil()";
   ASSERT_EVENTUALLY([&]() {
-      ASSERT_STR_CONTAINS(DumpThreadStack(t->tid()), "SleeperThread");
-    });
+    ASSERT_STR_CONTAINS(DumpThreadStack(t->tid()), kTestThreadStackFrame);
+  });
 
   // Test that we can change the signal and that the stack traces still work,
   // on the new signal.
@@ -135,7 +140,7 @@ TEST_F(DebugUtilTest, TestSignalStackTrace) {
   ASSERT_FALSE(IsSignalHandlerRegistered(SIGUSR2));
 
   // Stack traces should work using the new handler.
-  ASSERT_STR_CONTAINS(DumpThreadStack(t->tid()), "SleeperThread");
+  ASSERT_STR_CONTAINS(DumpThreadStack(t->tid()), kTestThreadStackFrame);
 
   // Switch back to SIGUSR2 and ensure it changes back.
   ASSERT_OK(SetStackTraceSignal(SIGUSR2));
@@ -143,7 +148,7 @@ TEST_F(DebugUtilTest, TestSignalStackTrace) {
   ASSERT_FALSE(IsSignalHandlerRegistered(SIGHUP));
 
   // Stack traces should work using the new handler.
-  ASSERT_STR_CONTAINS(DumpThreadStack(t->tid()), "SleeperThread");
+  ASSERT_STR_CONTAINS(DumpThreadStack(t->tid()), kTestThreadStackFrame);
 
   // Register our own signal handler on SIGHUP, and ensure that
   // we get a bad Status if we try to use it.

Reply via email to