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

Async uncaught exception not shown in default reporter and has useless stack #511

Closed
sindresorhus opened this issue Feb 5, 2016 · 13 comments
Labels
bug current functionality does not work as desired help wanted

Comments

@sindresorhus
Copy link
Member

With latest master (d51c331).

import test from 'ava';

test.cb(t => {
    setImmediate(() => {
        throw new Error('foo');
        t.end();
    });
});

Default reporter:


  ✖ Test results were not received from test.js

Verbose reporter:

Uncaught Exception: test/stream.js
  Error: foo
    Immediate._onImmediate (stream.js:5:9)



  ✖ Test results were not received from test.js

It should show the uncaught exception in the default reporter and a more useful stack in both.

@sindresorhus sindresorhus added bug current functionality does not work as desired help wanted labels Feb 5, 2016
@novemberborn
Copy link
Member

In #502 I change how these "no results received" errors are propagated. They're now treated as uncaught exceptions and, crucially, don't stop the tests from running. It seems to fix this case too!

$(npm bin)/ava foo.js

  2 exceptions

  1. Uncaught Exception
  Error: foo
    Immediate._onImmediate (foo.js:5:15)


  2. Test results were not received from foo.js
(npm bin)/ava --verbose foo.js

Uncaught Exception: foo.js
  Error: foo
    Immediate._onImmediate (foo.js:5:15)



  ✖ Test results were not received from foo.js

  0 tests passed
  2 uncaught exceptions

@novemberborn
Copy link
Member

Though I must admit that I haven't rebased on top of master yet. Will check again once I've done that.

@novemberborn
Copy link
Member

Output is the same.

@sindresorhus
Copy link
Member Author

@novemberborn I assume this can be closed now then?

@novemberborn
Copy link
Member

Yea

@tusharmath
Copy link

I am facing the same problem here — https://travis-ci.org/tusharmath/Multi-threaded-downloader/builds/117959834

@novemberborn
Copy link
Member

@tusharmath it doesn't output any uncaught exception though. Maybe you're running into the issue discussed here: #604 (comment)

@tusharmath
Copy link

Tests run fine locally. I'm not sure what the issue is. Could you elaborate
a little more please?

On Wed, Mar 23, 2016, 8:01 PM Mark Wubben notifications@github.com wrote:

@tusharmath https://github.com/tusharmath it doesn't output the
uncaught exception though. Maybe you're running into the issue discussed
here: #604 (comment)
#604 (comment)


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#511 (comment)

Regards,
Tushar Mathur.
www.tusharm.com

@novemberborn
Copy link
Member

#604 discusses an issue where Travis kills the test processes. I suspect you're running into that problem.

The behavior described in this issue is by design.

@tusharmath
Copy link

@novemberborn Some pointers to mitigate the problem would be a great help. I went thru the discussion but I am unable to co-relate it with my issue.
Take a look at this https://travis-ci.org/tusharmath/Multi-threaded-downloader/builds/118039275
This is without coverage and it just works.

@novemberborn
Copy link
Member

@tusharmath try running with the --serial CLI flag to work around the issues described in #604.

@tusharmath
Copy link

That din't work either. Infact I tried creating folders and run them one by one also. Did not work.

@novemberborn
Copy link
Member

@tusharmath could you open a new issue to discuss this in?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug current functionality does not work as desired help wanted
Projects
None yet
Development

No branches or pull requests

3 participants