[SERVER-20055] ParallelTester.run() does not display stack trace of embedded error Created: 19/Aug/15  Updated: 19/Sep/15  Resolved: 24/Aug/15

Status: Closed
Project: Core Server
Component/s: JavaScript
Affects Version/s: 3.1.6
Fix Version/s: 3.1.8

Type: Bug Priority: Major - P3
Reporter: Benety Goh Assignee: Mira Carey
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Related
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Platform 8 08/28/15
Participants:
Linked BF Score: 0

 Description   

When the basicPlus.js parallel test suite fails, we do not get a stack trace of the assertion that failed. Example:

[js_test:basicPlus] 2015-08-19T21:18:08.749+0000          S3 Test : jstests/core/role_management_helpers.js ...
[js_test:basicPlus] 2015-08-19T21:18:08.752+0000 {
[js_test:basicPlus] 2015-08-19T21:18:08.752+0000 	"role" : "roleA",
[js_test:basicPlus] 2015-08-19T21:18:08.752+0000 	"roles" : [ ],
[js_test:basicPlus] 2015-08-19T21:18:08.752+0000 	"privileges" : [
[js_test:basicPlus] 2015-08-19T21:18:08.752+0000 		{
[js_test:basicPlus] 2015-08-19T21:18:08.752+0000 			"resource" : {
[js_test:basicPlus] 2015-08-19T21:18:08.752+0000 				"db" : "role_management_helpers",
[js_test:basicPlus] 2015-08-19T21:18:08.753+0000 				"collection" : "foo"
[js_test:basicPlus] 2015-08-19T21:18:08.753+0000 			},
[js_test:basicPlus] 2015-08-19T21:18:08.753+0000 			"actions" : [
[js_test:basicPlus] 2015-08-19T21:18:08.753+0000 				"find"
[js_test:basicPlus] 2015-08-19T21:18:08.753+0000 			]
[js_test:basicPlus] 2015-08-19T21:18:08.753+0000 		}
[js_test:basicPlus] 2015-08-19T21:18:08.753+0000 	]
[js_test:basicPlus] 2015-08-19T21:18:08.753+0000 }
[js_test:basicPlus] 2015-08-19T21:18:08.754+0000 { "role" : "roleB", "privileges" : [ ], "roles" : [ "roleA" ] }
[js_test:basicPlus] 2015-08-19T21:18:08.756+0000 2015-08-19T21:18:08.755+0000 E QUERY    [thread4] Unknown Failure from JSInterpreter
[js_test:basicPlus] 2015-08-19T21:18:08.756+0000 
[js_test:basicPlus] 2015-08-19T21:18:08.756+0000 ********** Parallel Test FAILED: Error: error loading js file: jstests/core/role_management_helpers.js



 Comments   
Comment by Githook User [ 21/Aug/15 ]

Author:

{u'username': u'hanumantmk', u'name': u'Jason Carey', u'email': u'jcarey@argv.me'}

Message: SERVER-20055 try harder in _checkErrorState in JS

_checkErrorState looks for an exception that's cleared the top of the js
stack, but not a pending one. Check there too, to avoid stackless sad
errors in a few more cases.
Branch: master
https://github.com/mongodb/mongo/commit/96ac2fda3c2a080be037e9c043e4ee262ec5d850

Comment by Mira Carey [ 19/Aug/15 ]

Nevermind, this looks like it's more to due with ::exec and js's load() than anything in parallel (though it relies on the fact that we echo error's on ::exec to error(), which is kind of silly).

Looks fixable in implscope.cpp

Comment by Mira Carey [ 19/Aug/15 ]

parallelTester.js

 "try {" +
                            "__parallelTests__fun.apply( 0, __parallelTests__argv );" +
                            "__parallelTests__passed = true;" +
                         "} catch ( e ) {" +
                            "print('');" +
                            "print( '********** Parallel Test FAILED: ' + tojson(e) );" +
                            "print('');" +
                         "}" +

I think we just need to mock up tojson() to include stacks. Or add a + e.stack after with an instance check

Generated at Thu Feb 08 03:53:00 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.