summaryrefslogtreecommitdiff
path: root/jstests/libunwind
diff options
context:
space:
mode:
Diffstat (limited to 'jstests/libunwind')
-rw-r--r--jstests/libunwind/stacktrace_signal.js19
1 files changed, 19 insertions, 0 deletions
diff --git a/jstests/libunwind/stacktrace_signal.js b/jstests/libunwind/stacktrace_signal.js
new file mode 100644
index 00000000000..ac35ffe711f
--- /dev/null
+++ b/jstests/libunwind/stacktrace_signal.js
@@ -0,0 +1,19 @@
+/**
+ * Hit mongod with a SIGUSR2 and observe multithread stack trace.
+ * Should only work on Linux, and when mongod is built with libunwind.
+ *
+ * @tags: [
+ * requires_libunwind
+ * ]
+ */
+(function() {
+clearRawMongoProgramOutput();
+const conn = MongoRunner.runMongod();
+runMongoProgram('/bin/kill', '-s', 'SIGUSR2', conn.pid);
+MongoRunner.stopMongod(conn);
+const output = rawMongoProgramOutput();
+assert(output.search(/"threadInfo":/) >= 0, output);
+assert(output.search(/"processInfo":/) >= 0, output);
+// Will be several of these
+assert(output.search(/"backtrace":/) >= 0, output);
+})();