nikseras / js-test-driver

Automatically exported from code.google.com/p/js-test-driver
0 stars 0 forks source link

Missing Stack Trace #339

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Run a test that htis code that throws an error (eg. throw new Error("foo"))
2. See the test fail ... without any indication whatsoever where the failure 
came from

What is the expected output? What do you see instead?
The standard in test runners is to show a full stack trace of any exception 
that occurs; I'd expect to see that, not just: 
    Test.testFoo failed (22.00 ms): Error: foo

What version of the product are you using? On what operating system?
1.3.4-a, Linux, Firefox

Please provide any additional information below.
I'm almost certain I've seen stacktraces in the test runner output before, so 
I'm not sure if this issue is only applicable to explicitly thrown errors (I 
*think* it is, but I haven't done heavy testing or anything), or if there is 
some other set of conditions.

Original issue reported on code.google.com by jer...@syapse.com on 16 Feb 2012 at 10:53

GoogleCodeExporter commented 8 years ago
Just saw a case of a system-generated error similarly not providing a stack 
trace.  Perhaps I have something mis-configured?  If this was a JSTD-wide issue 
I'd think this bug would have a lot more stars ...

Original comment by jer...@syapse.com on 17 Feb 2012 at 11:49

GoogleCodeExporter commented 8 years ago
Version of FF?

Original comment by corbinrs...@gmail.com on 18 Feb 2012 at 12:15

GoogleCodeExporter commented 8 years ago
9.0.1

Original comment by jer...@syapse.com on 19 Feb 2012 at 2:07

GoogleCodeExporter commented 8 years ago
I don't suppose there is an earlier version of JSTD that is known to have stack 
traces?  Not having stack traces is a pretty big limitation unfortunately (you 
wind up spending A LOT of time writing jstestdriver.console.log statements ...).

Original comment by jer...@syapse.com on 24 Feb 2012 at 9:32

GoogleCodeExporter commented 8 years ago
Hmm... I'm having problems reproducing this. I'm using firefox 9.0.1 on Ubuntu 
10.04 LTS.

Can you run the test will --runnerMode=DEBUG and include the log? (you may want 
to check it for proprietary code, of course)

You could give Chrome a shot, as an alternative. I highly suspect that you'll 
be missing stack traces on all of them.

Original comment by corbinrs...@gmail.com on 24 Feb 2012 at 9:47

GoogleCodeExporter commented 8 years ago
I tried with Firefox and Chrome simultaneously, and yes they were both missing 
the stacktrace.  Here's the log from that run (with large chunks of FileInfo 
lines "censored"; hopefully that doesn't hurt debugging).

java -jar ../../bin/JsTestDriver-1.3.4-a.jar --config jsTestDriver.conf 
--verbose --tests testGetNumParentPatterns --runnerMode DEBUG

setting runnermode DEBUG
Feb 24, 2012 2:06:59 PM com.google.jstestdriver.JsTestDriverModule configure
FINE: Configured with:
flags:FlagsImpl [port=-1,
 sslPort=-1,
 server=null,
 testOutput=,
 browser=[],
 reset=false,
 browserTimeout=30000,
 config=DefaultConfigurationSource [name=jsTestDriver.conf],
 tests=[testGetNumParentPatterns],
 displayHelp=false,
 verbose=true,
 captureConsole=false,
 preloadFiles=false,
 dryRunFor=[],
 arguments=[],
 runnerMode=QUIET,
 requiredBrowsers=null,
 serverHandlerPrefix=com.google.jstestdriver.model.NullPathPrefix@4cb9e45a
 raiseOnFailure=false]
Files:[
    FileInfo [filePath=/home/jeremy/work/syapse_apps/src/syapse/static/js/jquery/jquery-1.4.2.js, length=-1, patches=null, serveOnly=false, timestamp=1329185469000], 

* Lots of other FileInfo lines (removed to not show off all our files) * 

    FileInfo [filePath=/home/jeremy/work/

syapse_apps/src/syapse/static/css/search.css, length=-1, patches=null, 
serveOnly=true, timestamp=1330107511000]]
server:http://localhost:4224
captureAddress:http://localhost:4224
outputStream:java.io.PrintStream@403ef810
basePath:BasePaths [paths=[/home/jeremy/work/syapse_apps/src/syapse]]
testSuiteTimeout:7200
tests:[
    FileInfo [filePath=/home/jeremy/work/syapse_apps/src/syapse/static/js/test/bbViewBaseTests.js, length=-1, patches=null, serveOnly=false, timestamp=1330112462000],

* More FileInfo lines *

plugins:[]
gateway:[{"matcher":"/assets/*","server":"http://localhost:8000/assets/"},{"matc
her":"/bdm/*","server":"http://localhost:8000/bdm/"},{"matcher":"/all_projects/*
","server":"http://localhost:8000/d/all_projects/"}]
Feb 24, 2012 2:06:59 PM com.google.jstestdriver.model.JstdTestCaseFactory 
createCases
FINE: creating default test case
Feb 24, 2012 2:06:59 PM com.google.jstestdriver.ActionRunner runActions
INFO: TestCases 1
Feb 24, 2012 2:06:59 PM com.google.jstestdriver.ActionRunner runActions
INFO: Running com.google.jstestdriver.action.ConfigureGatewayAction@342798e7
Feb 24, 2012 2:06:59 PM com.google.jstestdriver.ActionRunner runActions
INFO: Finished com.google.jstestdriver.action.ConfigureGatewayAction@342798e7
Feb 24, 2012 2:06:59 PM com.google.jstestdriver.ActionRunner runActions
INFO: Running com.google.jstestdriver.action.UploadAction@6da5db4b
Feb 24, 2012 2:06:59 PM com.google.jstestdriver.ActionRunner runActions
INFO: Finished com.google.jstestdriver.action.UploadAction@6da5db4b
Feb 24, 2012 2:06:59 PM com.google.jstestdriver.ActionRunner runActions
INFO: Running 
com.google.jstestdriver.browser.BrowserActionExecutorAction@451c0d60
Feb 24, 2012 2:06:59 PM 
com.google.jstestdriver.browser.BrowserActionExecutorAction run
FINE: Queueing BrowserActionRunner 
[com.google.jstestdriver.RunTestsAction@741827d1] for Chrome 16.0.912.77 Linux.
Feb 24, 2012 2:06:59 PM 
com.google.jstestdriver.browser.BrowserActionExecutorAction run
FINE: Queueing BrowserActionRunner 
[com.google.jstestdriver.RunTestsAction@741827d1] for Firefox 9.0.1 Linux.
Feb 24, 2012 2:06:59 PM com.google.jstestdriver.browser.BrowserActionRunner call
FINE: start session on 1330121051133 with id 
cb3b06be-f556-4916-9aac-d5990afc6957
Feb 24, 2012 2:06:59 PM com.google.jstestdriver.browser.BrowserActionRunner call
FINE: start session on 1330121136761 with id 
175bf569-1867-471a-89b7-2cd2ea978785
Feb 24, 2012 2:06:59 PM com.google.jstestdriver.browser.BrowserActionRunner call
INFO: Running BrowserAction com.google.jstestdriver.RunTestsAction@741827d1 
with JstdTestCase ([dependencies=[
    FileInfo [filePath=/home/jeremy/work/syapse_apps/src/syapse/static/js/jquery/jquery-1.4.2.js, length=-1, patches=null, serveOnly=false, timestamp=1329185469000], 

* Still more FileInfo *

Feb 24, 2012 2:06:59 PM com.google.jstestdriver.browser.BrowserActionRunner call
INFO: Running BrowserAction com.google.jstestdriver.RunTestsAction@741827d1 
with JstdTestCase ([dependencies=[
    FileInfo [filePath=/home/jeremy/work/syapse_apps/src/syapse/static/js/jquery/jquery-1.4.2.js, length=-1, patches=null, serveOnly=false, timestamp=1329185469000], 

* Boy JSTD sure likes to log FileInfo ... *

Feb 24, 2012 2:06:59 PM com.google.jstestdriver.output.MultiTestResultListener 
<init>
FINE: listener:com.google.jstestdriver.output.MultiTestResultListener@74c6eff5 
delegates: [com.google.jstestdriver.output.TestResultHolder@76b20352, 
com.google.jstestdriver.output.DefaultListener@306dbdc9]
Feb 24, 2012 2:06:59 PM com.google.jstestdriver.output.MultiTestResultListener 
<init>
FINE: listener:com.google.jstestdriver.output.MultiTestResultListener@30b3f9b8 
delegates: [com.google.jstestdriver.output.TestResultHolder@76b20352, 
com.google.jstestdriver.output.DefaultListener@306dbdc9]
Feb 24, 2012 2:06:59 PM com.google.jstestdriver.RunTestsActionResponseStream 
<init>
FINE: listener for tests 
com.google.jstestdriver.output.MultiTestResultListener@74c6eff5
Feb 24, 2012 2:06:59 PM com.google.jstestdriver.RunTestsActionResponseStream 
<init>
FINE: listener for tests 
com.google.jstestdriver.output.MultiTestResultListener@30b3f9b8
Feb 24, 2012 2:06:59 PM com.google.jstestdriver.CommandTask run
INFO: run default
Feb 24, 2012 2:06:59 PM com.google.jstestdriver.CommandTask run
INFO: run default
Feb 24, 2012 2:06:59 PM com.google.jstestdriver.CommandTask run
FINE: Starting upload for 1330121051133
Feb 24, 2012 2:06:59 PM com.google.jstestdriver.CommandTask run
FINE: Starting upload for 1330121136761
Feb 24, 2012 2:06:59 PM com.google.jstestdriver.FileUploader 
determineBrowserFileSet
FINE: Updating files []
Feb 24, 2012 2:06:59 PM com.google.jstestdriver.FileUploader uploadToTheBrowser
INFO: Files toupload []
Feb 24, 2012 2:06:59 PM com.google.jstestdriver.CommandTask run
FINE: Finished upload for 1330121051133
Feb 24, 2012 2:06:59 PM com.google.jstestdriver.CommandTask run
FINE: Starting 
{"command":"runTests","parameters":["[\"testGetNumParentPatterns\"]","false","1"
]} for 1330121051133
Feb 24, 2012 2:06:59 PM com.google.jstestdriver.FileUploader 
determineBrowserFileSet
FINE: Updating files []
Feb 24, 2012 2:06:59 PM com.google.jstestdriver.FileUploader uploadToTheBrowser
INFO: Files toupload []
Feb 24, 2012 2:06:59 PM com.google.jstestdriver.CommandTask run
FINE: Finished upload for 1330121136761
Feb 24, 2012 2:06:59 PM com.google.jstestdriver.CommandTask run
FINE: Starting 
{"command":"runTests","parameters":["[\"testGetNumParentPatterns\"]","false","1"
]} for 1330121136761
Firefox 9.0.1 Linux [FAILED] SearchTest.testGetNumParentPatterns
Feb 24, 2012 2:06:59 PM com.google.jstestdriver.CommandTask run
FINE: finished 
{"command":"runTests","parameters":["[\"testGetNumParentPatterns\"]","false","1"
]} for 1330121051133 with TEST_RESULT
Feb 24, 2012 2:06:59 PM com.google.jstestdriver.CommandTask run
FINE: finished 
{"command":"runTests","parameters":["[\"testGetNumParentPatterns\"]","false","1"
]} for 1330121051133
Feb 24, 2012 2:06:59 PM com.google.jstestdriver.browser.BrowserActionRunner call
FINE: stopping session on 1330121051133 with id 
cb3b06be-f556-4916-9aac-d5990afc6957
Chrome 16.0.912.77 Linux [FAILED] SearchTest.testGetNumParentPatterns
Feb 24, 2012 2:07:29 PM com.google.jstestdriver.CommandTask run
FINE: finished 
{"command":"runTests","parameters":["[\"testGetNumParentPatterns\"]","false","1"
]} for 1330121136761 with TEST_RESULT
Feb 24, 2012 2:07:29 PM com.google.jstestdriver.CommandTask run
FINE: finished 
{"command":"runTests","parameters":["[\"testGetNumParentPatterns\"]","false","1"
]} for 1330121136761
Feb 24, 2012 2:07:29 PM com.google.jstestdriver.browser.BrowserActionRunner call
FINE: stopping session on 1330121136761 with id 
175bf569-1867-471a-89b7-2cd2ea978785
Feb 24, 2012 2:07:29 PM 
com.google.jstestdriver.browser.BrowserActionExecutorAction run
FINE: Finished BrowserActions [com.google.jstestdriver.RunTestsAction@741827d1].
Total 2 tests (Passed: 0; Fails: 2; Errors: 0) (30059.00 ms)
  Firefox 9.0.1 Linux: Run 1 tests (Passed: 0; Fails: 1; Errors 0) (28.00 ms)
    SearchTest.testGetNumParentPatterns failed (28.00 ms): ReferenceError: pattern is not defined

  Chrome 16.0.912.77 Linux: Run 1 tests (Passed: 0; Fails: 1; Errors 0) (30059.00 ms)
    SearchTest.testGetNumParentPatterns failed (30059.00 ms): Error: Callback '#1' expired after 30000 ms during test step 'Step 1: Retrieve data for AnimalModel'
      Error: Callback '#1' expired after 30000 ms during test step 'Step 1: Retrieve data for AnimalModel'

Feb 24, 2012 2:07:29 PM com.google.jstestdriver.ActionRunner runActions
INFO: Finished 
com.google.jstestdriver.browser.BrowserActionExecutorAction@451c0d60
Feb 24, 2012 2:07:29 PM com.google.jstestdriver.ActionRunner runActions
INFO: 
Feb 24, 2012 2:07:29 PM com.google.jstestdriver.Main main
INFO: Finished action run.

Original comment by jer...@syapse.com on 24 Feb 2012 at 10:14

GoogleCodeExporter commented 8 years ago
No chrome? Now, I'm worried about which jar you have. Try using the attached 
jar and see if you get a stack (it's built from head.)

Original comment by corbinrs...@gmail.com on 24 Feb 2012 at 10:19

Attachments:

GoogleCodeExporter commented 8 years ago
Dunno if this helps or not, but I just got a piece of a stack trace from Chrome:

      Error: No data found for hasReference
          at [object Object].<anonymous> (native)
          at [object Object].getConstraintById (native)

In that exact same run Firefox had no trace at all though.

Original comment by jer...@syapse.com on 24 Feb 2012 at 10:23

GoogleCodeExporter commented 8 years ago
I've been trying both of the versions available on the downloads page (1.3.3d 
and 1.3.4-a).  When I just tried the version you provided however I wasn't able 
to start the server; it just gave me the list of args as if I wasn't providing 
one of the required ones.

I'm doing: java -jar ../../bin/JsTestDriver.jar -port 4224

Does this latest version require a new parameter?  I tried --server localhost 
and --server http://localhost, to no avail. 

Original comment by jer...@syapse.com on 24 Feb 2012 at 10:28

GoogleCodeExporter commented 8 years ago
--port

Original comment by corbinrs...@gmail.com on 24 Feb 2012 at 10:30

GoogleCodeExporter commented 8 years ago
LOL, I'm an idiot; thanks (and sorry).

As for the new version, again I got nothing from Firefox and a partial trace 
(with no line numbers) from Chrome:

Total 2 tests (Passed: 0; Fails: 2; Errors: 0) (517.00 ms)
  Firefox 9.0.1 Linux: Run 1 tests (Passed: 0; Fails: 1; Errors 0) (471.00 ms)
    SearchTest.testGetParentCidChain failed (471.00 ms): Error: No data found for hasReference

  Chrome 16.0.912.77 Linux: Run 1 tests (Passed: 0; Fails: 1; Errors 0) (517.00 ms)
    SearchTest.testGetParentCidChain failed (517.00 ms): Error: No data found for hasReference

      Error: No data found for hasReference
          at Array.forEach (native)
          at [object Object].<anonymous> (native)
          at [object Object].getConstraintById (native)

would another runnerMode DEBUG log be helpful?  Or an log from the server?

Original comment by jer...@syapse.com on 24 Feb 2012 at 10:45

GoogleCodeExporter commented 8 years ago
Best I can figure it's something with firefox. I hate to ask, but could you 
reinstall it?

Original comment by corbinrs...@gmail.com on 24 Feb 2012 at 10:47

GoogleCodeExporter commented 8 years ago
I just tried a run with Firefox closed, and Chrome gave me the same (mostly 
missing and completely line-number-less) trace, so there seems to at least be a 
partial issue that's not related to Firefox.

I can try redoing Firefox though; give me a few min to do some apt-get purging 
and I'll let you know

Original comment by jer...@syapse.com on 24 Feb 2012 at 10:52

GoogleCodeExporter commented 8 years ago
Ok, I lied about purging (remembered that I didn't want to lose my 
history/bookmarks/open tabs).  I did however do an apt-get remove followed by 
an apt-get install and ...

... still no stacktrace :(

Now, I'm running Linux Mint, not Ubuntu proper, so there's some small chance 
that the difference in what we're seeing is from something the Mint team did.  
However, I think that's fairly unlikely, as:

A) I don't think they tweak it except to mess with the search engines
B) Chrome is still (mostly) broken (and I don't *think* they mess with Chrome)

Is there a sample test that you're using that I could try testing?  Or does the 
JS of the test not even matter at this level?

Original comment by jer...@syapse.com on 24 Feb 2012 at 11:01

GoogleCodeExporter commented 8 years ago
As I noted in email, do any of your paths contain "/static/"?

And yes, there is a test for this. You need to checkout the code, run ant jar, 
and use the <jstd dir>/target/bin/JsTestDriver.jar the way you would normally.

Original comment by corbinrs...@gmail.com on 24 Feb 2012 at 11:08

GoogleCodeExporter commented 8 years ago
Commit 1146

Original comment by corbinrs...@gmail.com on 27 Feb 2012 at 1:27