-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
[Bug]: Modified ArrayBuffer exception when running Jest with SES enabled #11952
Comments
Hi @samsiegart , your second symptom
might be the JavaScript Standard's Override Mistake. SES has a mitigation for that. Try setting the lockdown lockdown({ overrideTaming: 'severe' }); See https://github.com/endojs/endo/blob/master/packages/ses/lockdown-options.md |
Please let us know if that changes the symptoms. Thanks. |
@erights That did in fact fix the issue and the test was able to run. However, I discovered that the way I'm calling
I'm not sure if it's possible at all to call lockdown before Jest in this manner, we may just need to call it after the testing environment is set up, in which case we get |
This seems to be a symptom of Jest’s general approach to fixing However, fixing “identity discontinuity hazards” in this fashion leads to whacking moles, if not forever, for a very long time. For example, I expect that calling It might be worthwhile to consider using 🙏 @mhofman for isolating the issues above. |
Hi! Yeah, this sounds like a symptom of #2549. I think the real solution at some point is the combination of nodejs/node#28823 and nodejs/node#31852, but there's not much movement on either, unfortunately.
I doubt we can do that as we need the ESM APIs of |
This issue is stale because it has been open for 1 year with no activity. Remove stale label or comment or this will be closed in 30 days. |
This is worth re-examining |
This issue is stale because it has been open for 1 year with no activity. Remove stale label or comment or this will be closed in 30 days. |
This issue was closed because it has been stalled for 30 days with no activity. Please open a new issue if the issue is still relevant, linking to this one. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Version
27.2.5
Steps to reproduce
yarn install
yarn test
Expected behavior
The test runs and passes.
Actual behavior
Test suite fails to run with:
Additional context
I am using SES in my application. Part of what SES does is freezes certain objects and types, like
ArrayBuffer
. It does this by invoking alockdown
function, which happens when doingimport '@agoric/install-ses'
insetupTests.js
in my repo. It appears that Jest is modifying theArrayBuffer
constructor in some way, causing this to break, and I would like to figure out where and why, and hopefully fix it so that Jest is compatible with SES.I have also tried running
lockdown
before Jest is loaded and executed, and I get a similar, but more opaque error:I believe this happens for the same reason. After
ArrayBuffer
is frozen, when Jest tries to modify the constructor, it throws an error.Any pointers to where this modification could be happening, or how to get a more informative stack trace to appear, would be greatly appreciated.
Environment
The text was updated successfully, but these errors were encountered: