fix(test): inject AbortSignal/TextEncoder into miner-extension-live-fetch vm sandbox#7092
Merged
Merged
Conversation
…ve-fetch vm sandbox node:vm's createContext() is a fresh, isolated realm with none of the outer process's globals. background.js's live-fetch path bounds its fetch with AbortSignal.timeout(...) (#4c0b19f4) and measures the real serialized byte size via TextEncoder for the quota guard (#7062), but the test harness never injected either global into the sandbox -- every call on the success path threw "<Global> is not defined", caught by the function's own try/catch and silently misreported as a typed failure result instead of a real one. Confirmed this isn't CI flakiness: reproduced deterministically outside CI, on every run, for any candidates payload that reaches the success path (all 4 of the 7 originally-failing tests exercise that path; the other 3 return early on a non-2xx/malformed/thrown-fetch branch before ever touching either global).
Contributor
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7092 +/- ##
==========================================
+ Coverage 93.74% 95.98% +2.23%
==========================================
Files 692 609 -83
Lines 68706 48144 -20562
Branches 18760 15133 -3627
==========================================
- Hits 64409 46209 -18200
+ Misses 3302 1118 -2184
+ Partials 995 817 -178
Flags with carried forward coverage won't be shown. Click here to find out more. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Test plan