-
Notifications
You must be signed in to change notification settings - Fork 42
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
fix: catch top level exception when preemptively creating streams #1584
Conversation
The test I added reproduces #1569 because of the following log line: and I can confirm the fix does remove this top level exception. However, I tried in several manner to catch the exception in the test so that the test could fail when the exception is raised but to no avail. Do you have any suggestion? |
size-limit report 📦
|
Tried multiple ways to catch the promise rejection but was only able to do it by checking the stderr. Might be another way but I'm no js expert.
|
e0d6eb6
to
5838338
Compare
I was able to detect the top level promise rejection and make the test fail based on it with:
@fbarbu15 it may be worth checking if we could have this piece of code present on all tests to ensure that Waku does not throw any uncaught exception or unhandled rejection. |
ab1a5bb
to
8cbd4c1
Compare
Another way to catch promise rejection that is not popping out and is somewhere deep in the code - I think fake promise can be used (if I properly understood the problem). It depends on the testing stack and I am not sure how to handle it in mocha/chai. Can research though |
thanks! |
I had a look at this and unfortunately this is making mocha exit with code 7 and stop execution of other tests. Also no test report is shown. I don't think this is what we want.
|
Resolves #1569