summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBilly Donahue <billy.donahue@mongodb.com>2020-01-15 15:13:16 +0000
committerevergreen <evergreen@mongodb.com>2020-01-15 15:13:16 +0000
commit1156b8a0008afc68d86e41400baf0f7f4e683210 (patch)
tree275cbb24fe377e52a13cd93dfffac6170ef74611
parent4119889d9cf5d3e1b9e23ecd112c7d4bf9773390 (diff)
downloadmongo-1156b8a0008afc68d86e41400baf0f7f4e683210.tar.gz
SERVER-45564 test SIGUSR2 multithread stacktrace
-rw-r--r--buildscripts/resmokeconfig/suites/libunwind.yml15
-rw-r--r--etc/evergreen.yml11
-rw-r--r--jstests/libunwind/stacktrace_signal.js19
3 files changed, 45 insertions, 0 deletions
diff --git a/buildscripts/resmokeconfig/suites/libunwind.yml b/buildscripts/resmokeconfig/suites/libunwind.yml
new file mode 100644
index 00000000000..1ee185e1c60
--- /dev/null
+++ b/buildscripts/resmokeconfig/suites/libunwind.yml
@@ -0,0 +1,15 @@
+test_kind: js_test
+
+selector:
+ roots:
+ - jstests/libunwind/*.js
+
+executor:
+ config:
+ shell_options:
+ readMode: commands
+ fixture:
+ class: MongoDFixture
+ mongod_options:
+ set_parameters:
+ enableTestCommands: 1
diff --git a/etc/evergreen.yml b/etc/evergreen.yml
index d8909386408..6f8a7698a12 100644
--- a/etc/evergreen.yml
+++ b/etc/evergreen.yml
@@ -6048,6 +6048,15 @@ tasks:
resmoke_args: --suites=sharded_jscore_txns_sharded_collections --storageEngine=wiredTiger
- <<: *task_template
+ name: libunwind_tests
+ tags: []
+ commands:
+ - func: "do setup"
+ - func: "run tests"
+ vars:
+ resmoke_args: --suites=libunwind --storageEngine=wiredTiger
+
+- <<: *task_template
name: causally_consistent_jscore_txns_passthrough
tags: ["causally_consistent"]
commands:
@@ -10313,6 +10322,7 @@ buildvariants:
distros:
- rhel70
- name: jsCore
+ - name: libunwind_tests
- <<: *enterprise-rhel-70-64-bit-template
name: hot_backups-rhel-70-64-bit
@@ -10360,6 +10370,7 @@ buildvariants:
- name: jsCore_txns_large_txns_format
- name: .jstestfuzz .common
- name: .logical_session_cache .one_sec
+ - name: libunwind_tests
- name: replica_sets_auth_gen
- name: replica_sets_jscore_passthrough
- name: .replica_sets .multi_oplog
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);
+})();