mirror of
https://github.com/denoland/deno.git
synced 2024-12-31 03:29:10 -05:00
fix(test): don't swallow sanitizer errors with permissions (#18550)
Missing `return` from #18246.
This commit is contained in:
parent
0210c1cadf
commit
e5588d2f1e
3 changed files with 9 additions and 4 deletions
|
@ -481,7 +481,7 @@ function withPermissions(fn, permissions) {
|
||||||
const token = pledgePermissions(permissions);
|
const token = pledgePermissions(permissions);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await fn(...new SafeArrayIterator(params));
|
return await fn(...new SafeArrayIterator(params));
|
||||||
} finally {
|
} finally {
|
||||||
restorePermissions(token);
|
restorePermissions(token);
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,7 +10,7 @@ error: Leaking async ops:
|
||||||
- 1 async operation to sleep for a duration was started in this test, but never completed. This is often caused by not cancelling a `setTimeout` or `setInterval` call. The operation was started here:
|
- 1 async operation to sleep for a duration was started in this test, but never completed. This is often caused by not cancelling a `setTimeout` or `setInterval` call. The operation was started here:
|
||||||
at [WILDCARD]
|
at [WILDCARD]
|
||||||
at setInterval ([WILDCARD])
|
at setInterval ([WILDCARD])
|
||||||
at [WILDCARD]/testdata/test/ops_sanitizer_unstable.ts:3:3
|
at fn ([WILDCARD]/testdata/test/ops_sanitizer_unstable.ts:7:5)
|
||||||
at [WILDCARD]
|
at [WILDCARD]
|
||||||
|
|
||||||
FAILURES
|
FAILURES
|
||||||
|
|
|
@ -1,4 +1,9 @@
|
||||||
Deno.test("no-op", function () {});
|
Deno.test("no-op", function () {});
|
||||||
Deno.test("leak interval", function () {
|
Deno.test({
|
||||||
setInterval(function () {}, 100000);
|
name: "leak interval",
|
||||||
|
// regression test for sanitizer errors being swallowed with permissions.
|
||||||
|
permissions: {},
|
||||||
|
fn() {
|
||||||
|
setInterval(function () {}, 100000);
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue