From 1156b8a0008afc68d86e41400baf0f7f4e683210 Mon Sep 17 00:00:00 2001 From: Billy Donahue Date: Wed, 15 Jan 2020 15:13:16 +0000 Subject: SERVER-45564 test SIGUSR2 multithread stacktrace --- buildscripts/resmokeconfig/suites/libunwind.yml | 15 +++++++++++++++ etc/evergreen.yml | 11 +++++++++++ jstests/libunwind/stacktrace_signal.js | 19 +++++++++++++++++++ 3 files changed, 45 insertions(+) create mode 100644 buildscripts/resmokeconfig/suites/libunwind.yml create mode 100644 jstests/libunwind/stacktrace_signal.js 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 @@ -6047,6 +6047,15 @@ tasks: vars: 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"] @@ -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); +})(); -- cgit v1.2.1