summaryrefslogtreecommitdiff
path: root/memtable
diff options
context:
space:
mode:
authorPeter Dillinger <peterd@fb.com>2022-10-18 00:35:35 -0700
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>2022-10-18 00:35:35 -0700
commite466173d5cb0735f49a905489be0eb889a26d89d (patch)
treea38b745850fcff121e9391376f1230c1d1a006e4 /memtable
parent8367f0d2d76de0f7d096cc65f5f9ebfb907d551a (diff)
Print stack traces on frozen tests in CI (#10828)
Summary: Instead of existing calls to ps from gnu_parallel, call a new wrapper that does ps, looks for unit test like processes, and uses pstack or gdb to print thread stack traces. Also, using `ps -wwf` instead of `ps -wf` ensures output is not cut off. For security, CircleCI runs with security restrictions on ptrace (/proc/sys/kernel/yama/ptrace_scope = 1), and this change adds a work-around to `InstallStackTraceHandler()` (only used by testing tools) to allow any process from the same user to debug it. (I've also touched >100 files to ensure all the unit tests call this function.) Pull Request resolved: https://github.com/facebook/rocksdb/pull/10828 Test Plan: local manual + temporary infinite loop in a unit test to observe in CircleCI Reviewed By: hx235 Differential Revision: D40447634 Pulled By: pdillinger fbshipit-source-id: 718a4c4a5b54fa0f9af2d01a446162b45e5e84e1
Diffstat (limited to 'memtable')
-rw-r--r--memtable/inlineskiplist_test.cc1
-rw-r--r--memtable/skiplist_test.cc1
-rw-r--r--memtable/write_buffer_manager_test.cc1
3 files changed, 3 insertions, 0 deletions
diff --git a/memtable/inlineskiplist_test.cc b/memtable/inlineskiplist_test.cc
index 4523aa770..1f3c6a691 100644
--- a/memtable/inlineskiplist_test.cc
+++ b/memtable/inlineskiplist_test.cc
@@ -658,6 +658,7 @@ TEST_F(InlineSkipTest, ConcurrentInsertWithHint3) {
} // namespace ROCKSDB_NAMESPACE
int main(int argc, char** argv) {
+ ROCKSDB_NAMESPACE::port::InstallStackTraceHandler();
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}
diff --git a/memtable/skiplist_test.cc b/memtable/skiplist_test.cc
index d35bc856d..1d43d734b 100644
--- a/memtable/skiplist_test.cc
+++ b/memtable/skiplist_test.cc
@@ -383,6 +383,7 @@ TEST_F(SkipTest, Concurrent5) { RunConcurrent(5); }
} // namespace ROCKSDB_NAMESPACE
int main(int argc, char** argv) {
+ ROCKSDB_NAMESPACE::port::InstallStackTraceHandler();
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}
diff --git a/memtable/write_buffer_manager_test.cc b/memtable/write_buffer_manager_test.cc
index f74565134..546df894a 100644
--- a/memtable/write_buffer_manager_test.cc
+++ b/memtable/write_buffer_manager_test.cc
@@ -298,6 +298,7 @@ TEST_F(ChargeWriteBufferTest, BasicWithCacheFull) {
} // namespace ROCKSDB_NAMESPACE
int main(int argc, char** argv) {
+ ROCKSDB_NAMESPACE::port::InstallStackTraceHandler();
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}