You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by bm...@apache.org on 2018/07/25 21:16:15 UTC
[2/3] mesos git commit: Installed google's signal handler for
libprocess benchmarks.
Installed google's signal handler for libprocess benchmarks.
This will provide a stack trace if the benchmarks crash, the
approach here was followed from the libprocess test main.cpp.
Review: https://reviews.apache.org/r/67889
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/54a8443d
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/54a8443d
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/54a8443d
Branch: refs/heads/master
Commit: 54a8443d76b2b43140e412f1d2bf73fee856885f
Parents: f3f75e8
Author: Benjamin Mahler <bm...@apache.org>
Authored: Wed Jul 11 15:47:04 2018 -0700
Committer: Benjamin Mahler <bm...@apache.org>
Committed: Wed Jul 25 14:13:51 2018 -0700
----------------------------------------------------------------------
3rdparty/libprocess/src/tests/benchmarks.cpp | 12 ++++++++++++
1 file changed, 12 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/54a8443d/3rdparty/libprocess/src/tests/benchmarks.cpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/src/tests/benchmarks.cpp b/3rdparty/libprocess/src/tests/benchmarks.cpp
index e3a604d..0b94aaf 100644
--- a/3rdparty/libprocess/src/tests/benchmarks.cpp
+++ b/3rdparty/libprocess/src/tests/benchmarks.cpp
@@ -71,6 +71,18 @@ int main(int argc, char** argv)
// Initialize Google Mock/Test.
testing::InitGoogleMock(&argc, argv);
+ // NOTE: Windows does not support signal semantics required for these
+ // handlers to be useful.
+#ifndef __WINDOWS__
+ // Install GLOG's signal handler.
+ google::InstallFailureSignalHandler();
+
+ // We reset the GLOG's signal handler for SIGTERM because
+ // 'SubprocessTest.Status' sends SIGTERM to a subprocess which
+ // results in a stack trace otherwise.
+ os::signals::reset(SIGTERM);
+#endif // __WINDOWS__
+
// Add the libprocess test event listeners.
::testing::TestEventListeners& listeners =
::testing::UnitTest::GetInstance()->listeners();