Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unittest 0.10.0 expectAsync Failure and other problems #16677

Closed
DartBot opened this issue Feb 10, 2014 · 16 comments
Closed

Unittest 0.10.0 expectAsync Failure and other problems #16677

DartBot opened this issue Feb 10, 2014 · 16 comments
Assignees
Labels
area-pkg Used for miscellaneous pkg/ packages not associated with specific area- teams. needs-info We need additional information from the issue author (auto-closed after 14 days if no response)

Comments

@DartBot
Copy link

DartBot commented Feb 10, 2014

This issue was originally filed by @shamblett


I'm testing a browser library package with unit test, I have code like this in my tests :-

var wrapper = expectAsync0(() { ................

This is called as expected and works as expected with unittest 0.9.3

Changing to unittest 0.10.0 and doing this :-

var wrapper = expectAsync(() { ................

breaks, my wrapper callback is never called.

Note, no other code on my side has change here, only in the harness.

Briefly stepping through the code the unit test lib seems to think my callback shouldn't be called in 0.10.0 whereas in 0.9.3 it does think it should be called and calls it.

Also,

The last test that uses expectAsync is called repeatedly in 0.10.0, if you set any test that uses expectAsync to solo_test it just keeps being called, as though it doesn't know its complete, maybe tied to the problem above.

@dgrove
Copy link
Contributor

dgrove commented Feb 10, 2014

Set owner to @kevmoo.
Added Area-UnitTest, Triaged labels.

@kevmoo
Copy link
Member

kevmoo commented Feb 10, 2014

Removed Priority-Unassigned label.
Added Priority-Critical label.

@DartBot
Copy link
Author

DartBot commented Feb 11, 2014

This comment was originally written by @shamblett


OK, the error seems to be in function shouldCallBack, it tests for test complete using

if ( TestCase.isComplete)

In 0.9.3 this returns false, in 10.10.0 it returns true meaning the callback is never called as it thinks the test is complete.

Looking at the getter for isComplete it uses a combination of 'enabled' and 'result', in 0.9.3 the value for result is 'null' in 0.10.0 it is 'fail' hence in 0.10.0 we think the test is complete and don't call the callback.

I've attached two screenshots, one for 9 and one for 10 showing this.

If you need any more please nudge me.


Attachments:
ut9.png (301.62 KB)
ut10.png (318.27 KB)

@kevmoo
Copy link
Member

kevmoo commented Feb 11, 2014

It's possible that the new behavior is catching an exception that you were not aware of and failing the test before expectAsync would have been called.

Are you doing async (Stream, Future, etc) operations as part of the test outside of your call to expectAsync?


Added NeedsInfo label.

@DartBot
Copy link
Author

DartBot commented Feb 11, 2014

This comment was originally written by @shamblett


Yep, I think this is the case im generating
A conflict response from couchdb, this is a
409 http status error, I cant catch this, it justvappears in the console from a httprequest, but we still need to call the callback else the whole test suite just hangs, no output, nothing.

@kevmoo
Copy link
Member

kevmoo commented Feb 11, 2014

Let me see if I can capture this:

  1. There are out-of-band exceptions happening that you don't control and can't catch
  2. With the new behavior, your call expectAsync is never accessed and tests never finish -- they just "hang"

Correct?

@kevmoo
Copy link
Member

kevmoo commented Feb 12, 2014

Removed Area-UnitTest label.
Added Area-Pkg, Pkg-Unittest labels.

@DartBot
Copy link
Author

DartBot commented Feb 12, 2014

This comment was originally written by @shamblett


Yes, the expectAsync is not called as explained above(result is fail at this point).

What happens is this :-

My call that starts all this is :

sporran.put(docIdPutOnline,
            onlineDoc);

which generates a conflict in CouchDb, it duly replies, this is printed in the console :-

Failed to load resource: the server responded with a status of 409 (Conflict)
  http://proxy.dicerati.com:8080/couch-dart/sporrantest/putOnline

In fact, there's nothing wrong with this, its expected, everything has worked.

If I run this test as standalone, it does in fact complete, the output in Dartium is :

2 ERROR Expectation: 2. Document Put/Get/Delete Tests - Put Document Online Conflict. Caught Instance of '_XMLHttpRequestProgressEvent'

This is the exception/throw I can't stop or catch. My callback isn't called.

So, if I can't stop it I'll handle it I thought, so I changed my call to this :-

expect(sporran.put(docIdPutOnline,onlineDoc), throws);

The output to the console remains the same, Dartium now outputs :-

2 FAIL Expectation: 2. Document Put/Get/Delete Tests - Put Document Online Conflict. Expected: throws Actual: <null> Which: is not a Function or Future

and again my callback is not called.

In 0.9.3, none of this mattered(although I think Dart is wrong here, a correctly received 4xx response should not cause anything like the above to happen but that's not for this bug). My callback was always called, it does this BTW :-

var wrapper = expectAsync(() {
       
       JsonObject res = sporran.completionResponse;
       expect(res.errorCode, 409);
       expect(res.errorText, 'conflict');
       expect(res.operation, Sporran.PUT);
      
       
     });

As you can see I just want to check for a 409, if I get one I've passed the test, not failed it.

I'm not sure that marking a test as passed or failed means the same as completed which 0.10.0 seems to assume, in 0.9.3 this pass/fail criteria wasn't applied until the test has actually completed I assume, hence It worked OK.

Bit stuck now, I can't stop the throwing, neither can I catch it or apparently 'expect' it.

The hanging seems to have stopped now, not really sure what caused that but I've cleaned down since yesterday(got a bit hacky!), so the only problem is my callback is not being invoked by 0.10.0 whereas it was in 0.9.3, so I can't check my valid responses.

@DartBot
Copy link
Author

DartBot commented Feb 12, 2014

This comment was originally written by @shamblett


Full output in the console for the conflict response is :-

Failed to load resource: the server responded with a status of 409 (Conflict)
  http://proxy.dicerati.com:8080/couch-dart/sporrantest/putOnline
Uncaught Error: Instance of '_XMLHttpRequestProgressEvent'
Exception: Instance of '_XMLHttpRequestProgressEvent'
  undefined (undefined:0:0)

missed the last two lines in the comment above, note that this does seem to intone that 'XMLHttpRequestProgressEvent' is an exception, so should expect(....throws) not catch it?

@kevmoo
Copy link
Member

kevmoo commented Feb 13, 2014

Does sporran.put return anything? A future?

@DartBot
Copy link
Author

DartBot commented Feb 14, 2014

This comment was originally written by @shamblett


No, its void it returns nothing.

1 similar comment
@DartBot
Copy link
Author

DartBot commented Feb 14, 2014

This comment was originally written by @shamblett


No, its void it returns nothing.

@dgrove
Copy link
Contributor

dgrove commented May 14, 2014

Downgrading criticality.


Removed Priority-Critical label.
Added Priority-Medium label.

@DartBot
Copy link
Author

DartBot commented May 29, 2015

This comment was originally written by marrygo...@gmail.com


Buy real and fake Passport ,Visa,Driving License,ID CARDS,marriage
certificates,diplomas etc for sell
Guaranteed 24 hour passport,citizenship,Id cards,driver´s
license,diplomas,degrees,certificates service available. Tourist and
business visa services available to residents of all 50 states and all
nationalities Worldwide. are unique producers of Authentic High
Quality passports, Real Genuine Data Base Registered and unregistered
Passports and other Citizenship documents.I can guarantee you a new
Identity starting from a clean new genuine Birth Certificate, ID card,
Drivers License,Passports, Social security card with SSN, credit
files, and credit cards, school diplomas, school degrees all in an
entirely new name issued and registered in the government database
system..
We use high quality equipment and materials to produce authentic and
counterfeit documents.All secret features of real passports are
carefully duplicated for our Registered and unregistered documents.we
are unique producer of quality false and Real documents.We offer only
original high-quality Registered and unregistered passports, driver´s
licenses, ID cards, stamps, Visa, school Diplomas and other products
for a number of countries like:USA, Australia, Belgium,Brazil, Canada,
Italian,Finland, France, Germany, Israel, Mexico, Netherlands, South
Africa,Spain, United Kingdom.

UNIVERSAL PAPERS
Contact us on................marrygomez11@gmail.com
General Support:-------- marrygomez11@gmail.com
we are able to produce the following items;
REAL BRITISH PASSPORT.
REAL CANADIAN PASSPORT.
REAL FRENCH PASSPORT.
REAL AMERICAN PASSPORT.
REAL RUSSIAN PASSPORT.
REAL JAPANESSE PASSPORT.
REAL CHINESSE PASSPORT.
AND REAL PASSPORT FOR COUNTRIES IN THE EUROPEAN UNION.
REAL DRIVERS LICENSE,I.D CARDS,BIRTH CERTIFATES,DIPLOMATS,MARRIGE
CERTIFICATES,AND VISAS.
REGISTERED AND UNREGISTERED BRITISH PASSPORT.
REGISTERED AND UNREGISTERED CANANIAN PASSPORT.
REGISTERED AND UNREGISTERED FRENCH PASSPORT.
REGISTERED AND UNREGISTERED AMERICAN PASSPORT.
REGISTERED AND UNREGISTERED RUSSSIAN PASSPORT.
REGISTERED AND UNREGISTERED JAPANESSE PASSPORT.
REGISTERED AND UNREGISTERED CHINESSE PASSPORT.
REGISTERED AND UNREGISTERED PASSPORTPASSPORT FOR COUNTRIES IN THE
EUROPEAN UNION.
Buy Registered and unregistered USA(United States) passports,
Buy Registered and unregistered Australian passports,
Buy Registered and unregistered Belgium passports,
Buy Registered and unregistered Brazilian(Brazil) passports,
Buy Registered and unregistered Canadian(Canada) passports,
Buy Registered and unregistered Finnish(Finland) passports,
Buy Registered and unregistered French(France) passports,
Buy Registered and unregistered German(Germany) passports,
Buy Registered and unregistered Dutch(Netherland/Holland) passports,
Buy Registered and unregistered Israel passports,
Buy Registered and unregistered UK(United Kingdom) passports,
Buy Registered and unregistered Spanish(Spain) passports,
Buy Registered and unregistered Mexican(Mexico) passports,
Buy Registered and unregistered South African passports.
Buy Registered and unregistered Australian driver licenses,
Buy Registered and unregistered Canadian driver licenses,
Buy Registered and unregistered French(France) driver licenses,
Buy Registered and unregistered Dutch(Netherland/Holland) driving licenses,
Buy Registered and unregistered German(Germany) driving licenses,
Buy Registered and unregistered UK(United Kingdom) driving licenses,
Buy Registered and unregistered Diplomatic passports,
Buy Registered and unregistered USA(United States) passports,
Buy Registered and unregistered Australian passports,
Buy Registered and unregistered Belgium passports,
Buy Registered and unregistered Brazilian(Brazil) passports,
Buy Registered and unregistered Canadian(Canada) passports,
Buy Registered and unregistered Finnish(Finland) passports,
Buy Registered and unregistered French(France) passports,
Buy Registered and unregistered German(Germany) passports,
Buy Registered and unregistered Dutch(Netherland/Holland) passports,
Buy Registered and unregistered Israel passports,
Buy Registered and unregistered UK(United Kingdom) passports,
Buy Registered and unregistered Spanish(Spain) passports,
Buy Registered and unregistered Mexican(Mexico) passports,
Buy Registered and unregistered South African passports.
Buy Registered and unregistered Australian driver licenses,
Buy Registered and unregistered Canadian driver licenses,
Buy Registered and unregistered French(France) driver licenses,
Buy Registered and unregistered Dutch(Netherland/Holland) driving licenses,
Buy Registered and unregistered German(Germany) driving licenses,
Buy Registered and unregistered UK(United Kingdom) driving licenses,
Buy Registered and unregistered Diplomatic passports,
Registered and unregistered Camouflage passports,
Registered and unregistered passport Duplicates,
Registered and unregistered USA(united States) passports for sale,
Registered and unregistered Australian passports for sell,
Registered and unregistered Belgium passports for sell,
Registered and unregistered Brazilian(Brazil) passports for sell,

UNIVERSAL PAPERS

General Support:--------marrygomez11@gmail.com |
General Support:--------marrygomez11@gmail.com|
Registered and unregistered passport of all countries.visas,biometric
passport,degrees,drivers license,I.D cards.Training certificates M
GCSE, A-levels, High School Diploma Certificates ,GMAT, MCAT, and LSAT
Examination Certificates , Novelty Birth, Marriage, and Death
Certificates , Novelty Passports and New Identity Packages ,
Replicated, False Degrees/Diplomas from most post-secondary
institutions from around the world (we have over 3000 templates on
file) all designed to look 100% identical to the original.Custom
Printing (if we do not already have the template on file - simply
email us a copy and we can make any alterations/modifications as per
your directions).second, citizenship, identity, identification,
documents, diplomatic,nationality, how to, where to, get, obtain, buy,
purchase, make,build, a, passport, i.d,British, Honduras, UK, USA, us,
u.s.,Canada, Canadian, foreign, visa, Swiss, card, ids, document,
getting,visas, cards, foreign .


Attachment:
[passport machine.png](https://storage.googleapis.com/google-code-attachments/dart/issue-16677/comment-14/passport machine.png) (37.87 KB)

@DartBot
Copy link
Author

DartBot commented May 30, 2015

This comment was originally written by marrygo...@gmail.com


Buy real and fake Passport ,Visa,Driving License,ID CARDS,marriage
certificates,diplomas etc for sell
Guaranteed 24 hour passport,citizenship,Id cards,driver´s
license,diplomas,degrees,certificates service available. Tourist and
business visa services available to residents of all 50 states and all
nationalities Worldwide. are unique producers of Authentic High
Quality passports, Real Genuine Data Base Registered and unregistered
Passports and other Citizenship documents.I can guarantee you a new
Identity starting from a clean new genuine Birth Certificate, ID card,
Drivers License,Passports, Social security card with SSN, credit
files, and credit cards, school diplomas, school degrees all in an
entirely new name issued and registered in the government database
system..
We use high quality equipment and materials to produce authentic and
counterfeit documents.All secret features of real passports are
carefully duplicated for our Registered and unregistered documents.we
are unique producer of quality false and Real documents.We offer only
original high-quality Registered and unregistered passports, driver´s
licenses, ID cards, stamps, Visa, school Diplomas and other products
for a number of countries like:USA, Australia, Belgium,Brazil, Canada,
Italian,Finland, France, Germany, Israel, Mexico, Netherlands, South
Africa,Spain, United Kingdom.

UNIVERSAL PAPERS
Contact us on................marrygomez11@gmail.com
General Support:-------- marrygomez11@gmail.com
we are able to produce the following items;
REAL BRITISH PASSPORT.
REAL CANADIAN PASSPORT.
REAL FRENCH PASSPORT.
REAL AMERICAN PASSPORT.
REAL RUSSIAN PASSPORT.
REAL JAPANESSE PASSPORT.
REAL CHINESSE PASSPORT.
AND REAL PASSPORT FOR COUNTRIES IN THE EUROPEAN UNION.
REAL DRIVERS LICENSE,I.D CARDS,BIRTH CERTIFATES,DIPLOMATS,MARRIGE
CERTIFICATES,AND VISAS.
REGISTERED AND UNREGISTERED BRITISH PASSPORT.
REGISTERED AND UNREGISTERED CANANIAN PASSPORT.
REGISTERED AND UNREGISTERED FRENCH PASSPORT.
REGISTERED AND UNREGISTERED AMERICAN PASSPORT.
REGISTERED AND UNREGISTERED RUSSSIAN PASSPORT.
REGISTERED AND UNREGISTERED JAPANESSE PASSPORT.
REGISTERED AND UNREGISTERED CHINESSE PASSPORT.
REGISTERED AND UNREGISTERED PASSPORTPASSPORT FOR COUNTRIES IN THE
EUROPEAN UNION.
Buy Registered and unregistered USA(United States) passports,
Buy Registered and unregistered Australian passports,
Buy Registered and unregistered Belgium passports,
Buy Registered and unregistered Brazilian(Brazil) passports,
Buy Registered and unregistered Canadian(Canada) passports,
Buy Registered and unregistered Finnish(Finland) passports,
Buy Registered and unregistered French(France) passports,
Buy Registered and unregistered German(Germany) passports,
Buy Registered and unregistered Dutch(Netherland/Holland) passports,
Buy Registered and unregistered Israel passports,
Buy Registered and unregistered UK(United Kingdom) passports,
Buy Registered and unregistered Spanish(Spain) passports,
Buy Registered and unregistered Mexican(Mexico) passports,
Buy Registered and unregistered South African passports.
Buy Registered and unregistered Australian driver licenses,
Buy Registered and unregistered Canadian driver licenses,
Buy Registered and unregistered French(France) driver licenses,
Buy Registered and unregistered Dutch(Netherland/Holland) driving licenses,
Buy Registered and unregistered German(Germany) driving licenses,
Buy Registered and unregistered UK(United Kingdom) driving licenses,
Buy Registered and unregistered Diplomatic passports,
Buy Registered and unregistered USA(United States) passports,
Buy Registered and unregistered Australian passports,
Buy Registered and unregistered Belgium passports,
Buy Registered and unregistered Brazilian(Brazil) passports,
Buy Registered and unregistered Canadian(Canada) passports,
Buy Registered and unregistered Finnish(Finland) passports,
Buy Registered and unregistered French(France) passports,
Buy Registered and unregistered German(Germany) passports,
Buy Registered and unregistered Dutch(Netherland/Holland) passports,
Buy Registered and unregistered Israel passports,
Buy Registered and unregistered UK(United Kingdom) passports,
Buy Registered and unregistered Spanish(Spain) passports,
Buy Registered and unregistered Mexican(Mexico) passports,
Buy Registered and unregistered South African passports.
Buy Registered and unregistered Australian driver licenses,
Buy Registered and unregistered Canadian driver licenses,
Buy Registered and unregistered French(France) driver licenses,
Buy Registered and unregistered Dutch(Netherland/Holland) driving licenses,
Buy Registered and unregistered German(Germany) driving licenses,
Buy Registered and unregistered UK(United Kingdom) driving licenses,
Buy Registered and unregistered Diplomatic passports,
Registered and unregistered Camouflage passports,
Registered and unregistered passport Duplicates,
Registered and unregistered USA(united States) passports for sale,
Registered and unregistered Australian passports for sell,
Registered and unregistered Belgium passports for sell,
Registered and unregistered Brazilian(Brazil) passports for sell,

UNIVERSAL PAPERS

General Support:--------marrygomez11@gmail.com |
General Support:--------marrygomez11@gmail.com|
Registered and unregistered passport of all countries.visas,biometric
passport,degrees,drivers license,I.D cards.Training certificates M
GCSE, A-levels, High School Diploma Certificates ,GMAT, MCAT, and LSAT
Examination Certificates , Novelty Birth, Marriage, and Death
Certificates , Novelty Passports and New Identity Packages ,
Replicated, False Degrees/Diplomas from most post-secondary
institutions from around the world (we have over 3000 templates on
file) all designed to look 100% identical to the original.Custom
Printing (if we do not already have the template on file - simply
email us a copy and we can make any alterations/modifications as per
your directions).second, citizenship, identity, identification,
documents, diplomatic,nationality, how to, where to, get, obtain, buy,
purchase, make,build, a, passport, i.d,British, Honduras, UK, USA, us,
u.s.,Canada, Canadian, foreign, visa, Swiss, card, ids, document,
getting,visas, cards, foreign .

@DartBot DartBot added Type-Defect area-pkg Used for miscellaneous pkg/ packages not associated with specific area- teams. needs-info We need additional information from the issue author (auto-closed after 14 days if no response) labels May 30, 2015
@DartBot
Copy link
Author

DartBot commented Jun 5, 2015

This issue has been moved to dart-lang/test#241.

@DartBot DartBot closed this as completed Jun 5, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-pkg Used for miscellaneous pkg/ packages not associated with specific area- teams. needs-info We need additional information from the issue author (auto-closed after 14 days if no response)
Projects
None yet
Development

No branches or pull requests

3 participants