diff options
author | Jonathan Abrahams <jonathan@mongodb.com> | 2015-12-11 09:07:56 -0500 |
---|---|---|
committer | Jonathan Abrahams <jonathan@mongodb.com> | 2015-12-11 09:22:49 -0500 |
commit | eca57c613d92b170a3bc0005354c127c3b369fe8 (patch) | |
tree | 5278e23910248b17f2117313bc59a46a5a3a34ff /jstests/concurrency | |
parent | d26f8791dfb9f7630e1fbe5fc972826296041932 (diff) | |
download | mongo-eca57c613d92b170a3bc0005354c127c3b369fe8.tar.gz |
SERVER-21500 Include the name of the FSM workload in the WorkloadFailure description
(cherry picked from commit f8e74606522b32978aca2c4dab8a23ec6d01defc)
Diffstat (limited to 'jstests/concurrency')
-rw-r--r-- | jstests/concurrency/fsm_libs/runner.js | 16 | ||||
-rw-r--r-- | jstests/concurrency/fsm_libs/worker_thread.js | 2 |
2 files changed, 9 insertions, 9 deletions
diff --git a/jstests/concurrency/fsm_libs/runner.js b/jstests/concurrency/fsm_libs/runner.js index cc765223eb7..dd91cd02411 100644 --- a/jstests/concurrency/fsm_libs/runner.js +++ b/jstests/concurrency/fsm_libs/runner.js @@ -258,13 +258,13 @@ var runner = (function() { } } - function WorkloadFailure(err, stack, kind) { + function WorkloadFailure(err, stack, header) { this.err = err; this.stack = stack; - this.kind = kind; + this.header = header; this.format = function format() { - return this.kind + '\n' + this.err + '\n\n' + this.stack; + return this.header + '\n' + this.err + '\n\n' + this.stack; }; } @@ -422,7 +422,7 @@ var runner = (function() { jsTest.log('End of schedule'); } - function cleanupWorkload(workload, context, cluster, errors, kind, dbHashBlacklist) { + function cleanupWorkload(workload, context, cluster, errors, header, dbHashBlacklist) { // Returns true if the workload's teardown succeeds and false if the workload's // teardown fails. @@ -435,14 +435,14 @@ var runner = (function() { cluster.checkDbHashes(dbHashBlacklist, 'before workload teardown'); } catch (e) { errors.push(new WorkloadFailure(e.toString(), e.stack, - kind + ' checking consistency on secondaries')); + header + ' checking consistency on secondaries')); return false; } try { teardownWorkload(workload, context, cluster); } catch (e) { - errors.push(new WorkloadFailure(e.toString(), e.stack, kind + ' Teardown')); + errors.push(new WorkloadFailure(e.toString(), e.stack, header + ' Teardown')); return false; } return true; @@ -513,7 +513,7 @@ var runner = (function() { // Threads must be joined before destruction, so do this // even in the presence of exceptions. errors.push(...threadMgr.joinAll().map(e => - new WorkloadFailure(e.err, e.stack, 'Foreground'))); + new WorkloadFailure(e.err, e.stack, 'Foreground ' + e.workloads.join(' ')))); } } finally { // Call each foreground workload's teardown function. After all teardowns have completed @@ -673,7 +673,7 @@ var runner = (function() { // Set a flag so background threads know to terminate. bgThreadMgr.markAllForTermination(); errors.push(...bgThreadMgr.joinAll().map(e => - new WorkloadFailure(e.err, e.stack, 'Background'))); + new WorkloadFailure(e.err, e.stack, 'Background ' + e.workloads.join(' ')))); } } finally { try { diff --git a/jstests/concurrency/fsm_libs/worker_thread.js b/jstests/concurrency/fsm_libs/worker_thread.js index 0e785195b5e..8fb4130d9a4 100644 --- a/jstests/concurrency/fsm_libs/worker_thread.js +++ b/jstests/concurrency/fsm_libs/worker_thread.js @@ -105,7 +105,7 @@ var workerThread = (function() { return { ok: 1 }; } catch(e) { args.errorLatch.countDown(); - return { ok: 0, err: e.toString(), stack: e.stack }; + return { ok: 0, err: e.toString(), stack: e.stack, workloads: workloads }; } } finally { // Avoid retention of connection object |