You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
agoric-sdk/packages/internal/src/lib-nodejs/ava-unhandled-rejection.js uses a subprocess and agoric-sdk/patches/ava+5.3.1.patch to isolate the test and then be able to expect a count of how many unhandled rejections it creates without crashing AVA.
Description of the Design
While the subprocess is still a good idea to prevent cross-contamination of unhandled rejections, @gibson042 had suggestions for how the subprocess could use the process.on events to count and handle rejections.
We could adopt the same algorithm from SES for unhandled rejections (only marking a rejection as unhandled upon GC of the Promise). That way, the tests won't be sensitive to the SES configuration itself.
This would be a modification just to the internals of ava-unhandled-rejection.js.
Security Considerations
Test code only.
Scaling Considerations
n/a
Test Plan
The point.
Upgrade Considerations
None.
The text was updated successfully, but these errors were encountered:
From @gibson042 : fail the test if an unhandled rejection doesn't happen
constunhandled=newSet();constonUnhandled=(_reason,p)=>{unhandled.add(p);};constonHandledLate=p=>{unhandled.delete(p);};process.on('unhandledRejection',onUnhandled);process.on('rejectionHandled',onHandledLate);t.teardown(()=>{process.off('unhandledRejection',onUnhandled);process.off('rejectionHandled',onHandledLate);});// …remainder of test body…t.true(unhandled.size>0);
What is the Problem Being Solved?
agoric-sdk/packages/internal/src/lib-nodejs/ava-unhandled-rejection.js
uses a subprocess andagoric-sdk/patches/ava+5.3.1.patch
to isolate the test and then be able to expect a count of how many unhandled rejections it creates without crashing AVA.Description of the Design
While the subprocess is still a good idea to prevent cross-contamination of unhandled rejections, @gibson042 had suggestions for how the subprocess could use the
process.on
events to count and handle rejections.We could adopt the same algorithm from SES for unhandled rejections (only marking a rejection as unhandled upon GC of the Promise). That way, the tests won't be sensitive to the SES configuration itself.
This would be a modification just to the internals of
ava-unhandled-rejection.js
.Security Considerations
Test code only.
Scaling Considerations
n/a
Test Plan
The point.
Upgrade Considerations
None.
The text was updated successfully, but these errors were encountered: