Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#14439 closed defect (fixed)

error returning dojo.Deferred instead of doh.Deferred from DOH test

Reported by: mm Owned by: bill
Priority: high Milestone: 1.8
Component: TestFramework Version: 1.7.0
Keywords: DOH, crash Cc:
Blocked By: Blocking:

Description (last modified by bill)

Runner crashes and prevents other methods from executing/

Reason is line:

1328 doh._testFinished(groupName, fixture, ret.results[0]);

in runner.js and ret.results being undefined

See attached testcase and screenshot from FF+FB

Attachments (4)

SampleTest.js (518 bytes) - added by mm 11 years ago.
runTests.html (618 bytes) - added by mm 11 years ago.
simplifiedWorks.js (298 bytes) - added by bill 11 years ago.
works using doh.Deferred, run as util/doh/runner.html?testModule=test.simplifiedWorks&registerModulePath=test,/trunk/runTests.html/..
simplified.js (293 bytes) - added by bill 11 years ago.
failure using dojo/_base/Deferred, run as http://localhost/trunk/util/doh/runner.html?testModule=test.simplified&registerModulePath=test,/trunk/runTests.html/..

Download all attachments as: .zip

Change History (11)

Changed 11 years ago by mm

Attachment: SampleTest.js added

Changed 11 years ago by mm

Attachment: runTests.html added

comment:1 Changed 11 years ago by mm

one quick comment: shall we use doh.Deferred or Deferred ?

sample http://livedocs.dojotoolkit.org/util/doh#simple-tests-no-setup-standalone-asynchronous-test states doh.Deferred, however it has no deferred.reject method as specified in the sample

Changed 11 years ago by bill

Attachment: simplifiedWorks.js added

works using doh.Deferred, run as util/doh/runner.html?testModule=test.simplifiedWorks&registerModulePath=test,/trunk/runTests.html/..

comment:2 Changed 11 years ago by bill

Component: GeneralTestFramework
Description: modified (diff)
Milestone: 1.8
Owner: set to bill
Priority: highnormal
severity: majorminor
Summary: DOH runner.js and deferred testerror returning dojo.Deferred instead of doh.Deferred from DOH test

In the past you needed to return doh.Deferred(). In 1.7 (and 1.6.1 and 1.5.2) you should be able to return dojo.Deferred(), see #12463. However, looks like you found a bug with that. The workaround is to keep using doh.Deferred.

As you mentioned, the documentation is inaccurate in that doh.Deferred still has the old names for methods: callback() and errback(), rather than resolve() and reject(). I'll update that.

Last edited 11 years ago by bill (previous) (diff)

comment:3 Changed 11 years ago by mm

or alias the methods in doh.Deffered as well.

comment:5 Changed 11 years ago by bill

Resolution: fixed
Status: newclosed

In [27362]:

Fix internal DOH exception when returning dojo.Deferred from a test where the Deferred threw, fixes #14439, refs #12463 !strict.

comment:6 Changed 11 years ago by mm

does it mean we shall try to use Deferred again instead of doh.Deffered for asnyc test results ?

comment:7 Changed 11 years ago by bill

Well, you can use a dojo.Deferred if it's more convenient. Most of the time doh.Deferred makes sense because it has convenient getTestCallback() and getTestErrback() methods.

Note: See TracTickets for help on using tickets.