rahu28 / js-test-driver

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

Failure in coverage plugin (NumberFormatException) #148

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Running coverage with a reasonably large .js file. Can't really isolate the 
cause more than that.
2.
3.

What is the expected output? What do you see instead?

Expected test results and coverage data. Instead got a failure. Stack trace:

Failures during test run.
Caused by:
java.lang.NumberFormatException: For input string: "NaN"
        at java.lang.NumberFormatException.forInputString(Unknown Source)
        at java.lang.Integer.parseInt(Unknown Source)
        at java.lang.Integer.parseInt(Unknown Source)
        at com.google.jstestdriver.coverage.FileCoverageDeserializer.parseToIntE
ndingWith(FileCoverageDeserializer.java:78)
        at com.google.jstestdriver.coverage.FileCoverageDeserializer.deserialize
Line(FileCoverageDeserializer.java:50)
        at com.google.jstestdriver.coverage.FileCoverageDeserializer.deserialize
Lines(FileCoverageDeserializer.java:40)
        at com.google.jstestdriver.coverage.FileCoverageDeserializer.deserialize
Coverage(FileCoverageDeserializer.java:20)
        at com.google.jstestdriver.coverage.FileCoverageDeserializer.deserialize
Coverages(FileCoverageDeserializer.java:29)
        at com.google.jstestdriver.coverage.CoverageTestResponseStream.stream(Co
verageTestResponseStream.java:62)
        at com.google.jstestdriver.AggregatingResponseStreamFactory$AggregatingR
esponseStream.stream(AggregatingResponseStreamFactory.java:92)
        at com.google.jstestdriver.CommandTask.run(CommandTask.java:97)
        at com.google.jstestdriver.JsTestDriverClientImpl.sendCommand(JsTestDriv
erClientImpl.java:93)
        at com.google.jstestdriver.JsTestDriverClientImpl.runAllTests(JsTestDriv
erClientImpl.java:115)
        at com.google.jstestdriver.RunTestsAction.run(RunTestsAction.java:60)
        at com.google.jstestdriver.BrowserActionRunner.call(BrowserActionRunner.
java:58)
        at com.google.jstestdriver.BrowserActionRunner.call(BrowserActionRunner.
java:33)
        at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
        at java.util.concurrent.FutureTask.run(Unknown Source)
        at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
        at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
        at java.util.concurrent.FutureTask.run(Unknown Source)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.
access$301(Unknown Source)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.
run(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source
)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)

        at com.google.jstestdriver.BrowserActionExecutorAction.run(BrowserAction
ExecutorAction.java:129)
        at com.google.jstestdriver.ActionRunner.runActions(ActionRunner.java:62)

        at com.google.jstestdriver.JsTestDriver.main(JsTestDriver.java:85)
Caused by:
java.lang.NumberFormatException: For input string: "NaN"

What version of the product are you using? On what operating system?

Using latest head (built on OS X)

Please provide any additional information below.

Smaller test cases are working fine.

Original issue reported on code.google.com by grams...@Bigfoot.com on 13 Oct 2010 at 10:03

GoogleCodeExporter commented 8 years ago
What's reasonably large?

Original comment by corbinrs...@gmail.com on 13 Oct 2010 at 10:37

GoogleCodeExporter commented 8 years ago
I don't think it is necessarily size related. I am testing a JS library (about 
50k). Simple tests that use about 40% of the code work. I tried a test that 
exercises much more of the code and had this problem.

Original comment by grams...@Bigfoot.com on 13 Oct 2010 at 10:59

GoogleCodeExporter commented 8 years ago
Here is some test code that caused a repro. If I included the first queue.defer 
below I had no problem; if I included both then I got a barf. It doesn't really 
seem to have an obvious trigger as these are identically structured tests:

    queue.defer(function(pool) {
        Syn.click({}, 
            cbox, 
            pool.add(
                function() {
                    assertEquals(false, model.checked);
                    assertEquals(false, cbox.checked);
                }
            ));
    });

    // click again

    queue.defer(function(pool) {
        Syn.click({}, 
            cbox, 
            pool.add(
                function() {
                    assertEquals(true, model.checked);
                    assertEquals(true, cbox.checked);
                }
            ));
    });

Original comment by grams...@Bigfoot.com on 14 Oct 2010 at 9:40