summaryrefslogtreecommitdiff
path: root/tests/testdata/test/sanitizer
diff options
context:
space:
mode:
authorHasanAlrimawi <141642411+HasanAlrimawi@users.noreply.github.com>2024-09-16 22:38:40 +0300
committerGitHub <noreply@github.com>2024-09-16 19:38:40 +0000
commite0b9c745c15720914f14996bf357d5b375e2dbd8 (patch)
tree0dfc717082bedb2eec13eceb5cdeb1ef12b8f7f5 /tests/testdata/test/sanitizer
parent6ce16145dd12d8a272cb543871276c33c8201a37 (diff)
chore: deprecate test itests (#25512)
This PR is part of #22907 --------- Signed-off-by: HasanAlrimawi <141642411+HasanAlrimawi@users.noreply.github.com> Co-authored-by: Bartek IwaƄczuk <biwanczuk@gmail.com>
Diffstat (limited to 'tests/testdata/test/sanitizer')
-rw-r--r--tests/testdata/test/sanitizer/exit_sanitizer.out38
-rw-r--r--tests/testdata/test/sanitizer/exit_sanitizer.ts11
-rw-r--r--tests/testdata/test/sanitizer/ops_sanitizer_closed_inside_started_before.out19
-rw-r--r--tests/testdata/test/sanitizer/ops_sanitizer_closed_inside_started_before.ts5
-rw-r--r--tests/testdata/test/sanitizer/ops_sanitizer_multiple_timeout_tests.out45
-rw-r--r--tests/testdata/test/sanitizer/ops_sanitizer_multiple_timeout_tests.ts10
-rw-r--r--tests/testdata/test/sanitizer/ops_sanitizer_multiple_timeout_tests_no_trace.out25
-rw-r--r--tests/testdata/test/sanitizer/ops_sanitizer_nexttick.out6
-rw-r--r--tests/testdata/test/sanitizer/ops_sanitizer_nexttick.ts11
-rw-r--r--tests/testdata/test/sanitizer/ops_sanitizer_step_leak.out10
-rw-r--r--tests/testdata/test/sanitizer/ops_sanitizer_step_leak.ts10
-rw-r--r--tests/testdata/test/sanitizer/ops_sanitizer_tcp.out24
-rw-r--r--tests/testdata/test/sanitizer/ops_sanitizer_tcp.ts4
-rw-r--r--tests/testdata/test/sanitizer/ops_sanitizer_timeout_failure.out6
-rw-r--r--tests/testdata/test/sanitizer/ops_sanitizer_timeout_failure.ts22
-rw-r--r--tests/testdata/test/sanitizer/ops_sanitizer_unstable.out22
-rw-r--r--tests/testdata/test/sanitizer/ops_sanitizer_unstable.ts10
-rw-r--r--tests/testdata/test/sanitizer/resource_sanitizer.out20
-rw-r--r--tests/testdata/test/sanitizer/resource_sanitizer.ts4
-rw-r--r--tests/testdata/test/sanitizer/trace_ops_caught_error/main.out6
-rw-r--r--tests/testdata/test/sanitizer/trace_ops_caught_error/main.ts13
21 files changed, 0 insertions, 321 deletions
diff --git a/tests/testdata/test/sanitizer/exit_sanitizer.out b/tests/testdata/test/sanitizer/exit_sanitizer.out
deleted file mode 100644
index 305d51cc8..000000000
--- a/tests/testdata/test/sanitizer/exit_sanitizer.out
+++ /dev/null
@@ -1,38 +0,0 @@
-Check [WILDCARD]/exit_sanitizer.ts
-running 3 tests from [WILDCARD]/exit_sanitizer.ts
-exit(0) ... FAILED ([WILDCARD])
-exit(1) ... FAILED ([WILDCARD])
-exit(2) ... FAILED ([WILDCARD])
-
- ERRORS
-
-exit(0) => [WILDCARD]/exit_sanitizer.ts:[WILDCARD]
-error: Error: Test case attempted to exit with exit code: 0
- Deno.exit(0);
- ^
- at [WILDCARD]
- at [WILDCARD]/exit_sanitizer.ts:2:8
-
-exit(1) => [WILDCARD]/exit_sanitizer.ts:[WILDCARD]
-error: Error: Test case attempted to exit with exit code: 1
- Deno.exit(1);
- ^
- at [WILDCARD]
- at [WILDCARD]/exit_sanitizer.ts:6:8
-
-exit(2) => [WILDCARD]/exit_sanitizer.ts:[WILDCARD]
-error: Error: Test case attempted to exit with exit code: 2
- Deno.exit(2);
- ^
- at [WILDCARD]
- at [WILDCARD]/exit_sanitizer.ts:10:8
-
- FAILURES
-
-exit(0) => [WILDCARD]/exit_sanitizer.ts:[WILDCARD]
-exit(1) => [WILDCARD]/exit_sanitizer.ts:[WILDCARD]
-exit(2) => [WILDCARD]/exit_sanitizer.ts:[WILDCARD]
-
-FAILED | 0 passed | 3 failed ([WILDCARD])
-
-error: Test failed
diff --git a/tests/testdata/test/sanitizer/exit_sanitizer.ts b/tests/testdata/test/sanitizer/exit_sanitizer.ts
deleted file mode 100644
index 186406a9d..000000000
--- a/tests/testdata/test/sanitizer/exit_sanitizer.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-Deno.test("exit(0)", function () {
- Deno.exit(0);
-});
-
-Deno.test("exit(1)", function () {
- Deno.exit(1);
-});
-
-Deno.test("exit(2)", function () {
- Deno.exit(2);
-});
diff --git a/tests/testdata/test/sanitizer/ops_sanitizer_closed_inside_started_before.out b/tests/testdata/test/sanitizer/ops_sanitizer_closed_inside_started_before.out
deleted file mode 100644
index ffccd8422..000000000
--- a/tests/testdata/test/sanitizer/ops_sanitizer_closed_inside_started_before.out
+++ /dev/null
@@ -1,19 +0,0 @@
-Check [WILDCARD]/ops_sanitizer_closed_inside_started_before.ts
-running 1 test from [WILDCARD]/ops_sanitizer_closed_inside_started_before.ts
-test 1 ... FAILED [WILDCARD]
-
- ERRORS
-
-test 1 => [WILDCARD]/ops_sanitizer_closed_inside_started_before.ts:[WILDCARD]
-error: Leaks detected:
- - A timer was started before the test, but completed during the test. Intervals and timers should not complete in a test if they were not started in that test. This is often caused by not calling `clearTimeout`. The operation was started here:
- at [WILDCARD]
- at [WILDCARD]/ops_sanitizer_closed_inside_started_before.ts:[WILDCARD]
-
- FAILURES
-
-test 1 => [WILDCARD]/ops_sanitizer_closed_inside_started_before.ts:[WILDCARD]
-
-FAILED | 0 passed | 1 failed [WILDCARD]
-
-error: Test failed
diff --git a/tests/testdata/test/sanitizer/ops_sanitizer_closed_inside_started_before.ts b/tests/testdata/test/sanitizer/ops_sanitizer_closed_inside_started_before.ts
deleted file mode 100644
index 97d3d72c8..000000000
--- a/tests/testdata/test/sanitizer/ops_sanitizer_closed_inside_started_before.ts
+++ /dev/null
@@ -1,5 +0,0 @@
-const timer = setTimeout(() => {}, 10000000000);
-
-Deno.test("test 1", () => {
- clearTimeout(timer);
-});
diff --git a/tests/testdata/test/sanitizer/ops_sanitizer_multiple_timeout_tests.out b/tests/testdata/test/sanitizer/ops_sanitizer_multiple_timeout_tests.out
deleted file mode 100644
index 38d7fbb52..000000000
--- a/tests/testdata/test/sanitizer/ops_sanitizer_multiple_timeout_tests.out
+++ /dev/null
@@ -1,45 +0,0 @@
-Check [WILDCARD]/ops_sanitizer_multiple_timeout_tests.ts
-running 2 tests from [WILDCARD]/ops_sanitizer_multiple_timeout_tests.ts
-test 1 ... FAILED ([WILDCARD])
-test 2 ... FAILED ([WILDCARD])
-
- ERRORS
-
-test 1 => [WILDCARD]/ops_sanitizer_multiple_timeout_tests.ts:[WILDCARD]
-error: Leaks detected:
- - A timer was started in this test, but never completed. This is often caused by not calling `clearTimeout`. The operation was started here:
- at [WILDCARD]
- at setTimeout ([WILDCARD])
- at test ([WILDCARD]/ops_sanitizer_multiple_timeout_tests.ts:[WILDCARD])
- at [WILDCARD]/ops_sanitizer_multiple_timeout_tests.ts:8:27
- at [WILDCARD]
- - A timer was started in this test, but never completed. This is often caused by not calling `clearTimeout`. The operation was started here:
- at [WILDCARD]
- at setTimeout ([WILDCARD])
- at test ([WILDCARD]/ops_sanitizer_multiple_timeout_tests.ts:[WILDCARD])
- at [WILDCARD]/ops_sanitizer_multiple_timeout_tests.ts:8:27
- at [WILDCARD]
-
-test 2 => [WILDCARD]/ops_sanitizer_multiple_timeout_tests.ts:[WILDCARD]
-error: Leaks detected:
- - A timer was started in this test, but never completed. This is often caused by not calling `clearTimeout`. The operation was started here:
- at [WILDCARD]
- at setTimeout ([WILDCARD])
- at test ([WILDCARD]/ops_sanitizer_multiple_timeout_tests.ts:[WILDCARD])
- at [WILDCARD]/ops_sanitizer_multiple_timeout_tests.ts:10:27
- at [WILDCARD]
- - A timer was started in this test, but never completed. This is often caused by not calling `clearTimeout`. The operation was started here:
- at [WILDCARD]
- at setTimeout ([WILDCARD])
- at test ([WILDCARD]/ops_sanitizer_multiple_timeout_tests.ts:[WILDCARD])
- at [WILDCARD]/ops_sanitizer_multiple_timeout_tests.ts:10:27
- at [WILDCARD]
-
- FAILURES
-
-test 1 => [WILDCARD]/ops_sanitizer_multiple_timeout_tests.ts:[WILDCARD]
-test 2 => [WILDCARD]/ops_sanitizer_multiple_timeout_tests.ts:[WILDCARD]
-
-FAILED | 0 passed | 2 failed ([WILDCARD])
-
-error: Test failed
diff --git a/tests/testdata/test/sanitizer/ops_sanitizer_multiple_timeout_tests.ts b/tests/testdata/test/sanitizer/ops_sanitizer_multiple_timeout_tests.ts
deleted file mode 100644
index 1f52d481f..000000000
--- a/tests/testdata/test/sanitizer/ops_sanitizer_multiple_timeout_tests.ts
+++ /dev/null
@@ -1,10 +0,0 @@
-// https://github.com/denoland/deno/issues/8965
-
-function test() {
- setTimeout(() => {}, 10000);
- setTimeout(() => {}, 10001);
-}
-
-Deno.test("test 1", () => test());
-
-Deno.test("test 2", () => test());
diff --git a/tests/testdata/test/sanitizer/ops_sanitizer_multiple_timeout_tests_no_trace.out b/tests/testdata/test/sanitizer/ops_sanitizer_multiple_timeout_tests_no_trace.out
deleted file mode 100644
index c87cd0025..000000000
--- a/tests/testdata/test/sanitizer/ops_sanitizer_multiple_timeout_tests_no_trace.out
+++ /dev/null
@@ -1,25 +0,0 @@
-Check [WILDCARD]/ops_sanitizer_multiple_timeout_tests.ts
-running 2 tests from [WILDCARD]/ops_sanitizer_multiple_timeout_tests.ts
-test 1 ... FAILED ([WILDCARD])
-test 2 ... FAILED ([WILDCARD])
-
- ERRORS
-
-test 1 => [WILDCARD]/ops_sanitizer_multiple_timeout_tests.ts:[WILDCARD]
-error: Leaks detected:
- - 2 timers were started in this test, but never completed. This is often caused by not calling `clearTimeout`.
-To get more details where leaks occurred, run again with the --trace-leaks flag.
-
-test 2 => [WILDCARD]/ops_sanitizer_multiple_timeout_tests.ts:[WILDCARD]
-error: Leaks detected:
- - 2 timers were started in this test, but never completed. This is often caused by not calling `clearTimeout`.
-To get more details where leaks occurred, run again with the --trace-leaks flag.
-
- FAILURES
-
-test 1 => [WILDCARD]/ops_sanitizer_multiple_timeout_tests.ts:[WILDCARD]
-test 2 => [WILDCARD]/ops_sanitizer_multiple_timeout_tests.ts:[WILDCARD]
-
-FAILED | 0 passed | 2 failed ([WILDCARD])
-
-error: Test failed
diff --git a/tests/testdata/test/sanitizer/ops_sanitizer_nexttick.out b/tests/testdata/test/sanitizer/ops_sanitizer_nexttick.out
deleted file mode 100644
index 407699b6a..000000000
--- a/tests/testdata/test/sanitizer/ops_sanitizer_nexttick.out
+++ /dev/null
@@ -1,6 +0,0 @@
-running 2 tests from [WILDCARD]/ops_sanitizer_nexttick.ts
-test 1 ... ok ([WILDCARD])
-test 2 ... ok ([WILDCARD])
-
-ok | 2 passed | 0 failed ([WILDCARD])
-
diff --git a/tests/testdata/test/sanitizer/ops_sanitizer_nexttick.ts b/tests/testdata/test/sanitizer/ops_sanitizer_nexttick.ts
deleted file mode 100644
index 9ad3a7b28..000000000
--- a/tests/testdata/test/sanitizer/ops_sanitizer_nexttick.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-import { nextTick } from "node:process";
-
-// https://github.com/denoland/deno_std/issues/1651
-
-Deno.test("test 1", async () => {
- await new Promise<void>((resolve) => nextTick(resolve));
-});
-
-Deno.test("test 2", async () => {
- await new Promise<void>((resolve) => nextTick(resolve));
-});
diff --git a/tests/testdata/test/sanitizer/ops_sanitizer_step_leak.out b/tests/testdata/test/sanitizer/ops_sanitizer_step_leak.out
deleted file mode 100644
index be88a6e1d..000000000
--- a/tests/testdata/test/sanitizer/ops_sanitizer_step_leak.out
+++ /dev/null
@@ -1,10 +0,0 @@
-Check [WILDCARD]/ops_sanitizer_step_leak.ts
-running 1 test from [WILDCARD]/ops_sanitizer_step_leak.ts
-timeout ...
- step ... ok [WILDCARD]
-------- output -------
-done
------ output end -----
-timeout ... ok [WILDCARD]
-
-ok | 1 passed (1 step) | 0 failed [WILDCARD] \ No newline at end of file
diff --git a/tests/testdata/test/sanitizer/ops_sanitizer_step_leak.ts b/tests/testdata/test/sanitizer/ops_sanitizer_step_leak.ts
deleted file mode 100644
index 3fb9b397e..000000000
--- a/tests/testdata/test/sanitizer/ops_sanitizer_step_leak.ts
+++ /dev/null
@@ -1,10 +0,0 @@
-Deno.test("timeout", async (t) => {
- const timer = setTimeout(() => {
- console.log("timeout");
- }, 10000);
- clearTimeout(timer);
- await t.step("step", async () => {
- await new Promise<void>((resolve) => setTimeout(() => resolve(), 10));
- });
- console.log("done");
-});
diff --git a/tests/testdata/test/sanitizer/ops_sanitizer_tcp.out b/tests/testdata/test/sanitizer/ops_sanitizer_tcp.out
deleted file mode 100644
index 7b5660379..000000000
--- a/tests/testdata/test/sanitizer/ops_sanitizer_tcp.out
+++ /dev/null
@@ -1,24 +0,0 @@
-Check [WILDCARD]/ops_sanitizer_tcp.ts
-running 1 test from [WILDCARD]/ops_sanitizer_tcp.ts
-testLeakTcpOps ... FAILED ([WILDCARD])
-
- ERRORS
-
-testLeakTcpOps => [WILDCARD]/ops_sanitizer_tcp.ts:[WILDCARD]
-error: Leaks detected:
- - A TCP listener was opened during the test, but not closed during the test. Close the TCP listener by calling `tcpListener.close()`.
- - An async operation to accept a TCP stream was started in this test, but never completed. This is often caused by not closing a `Deno.Listener`. The operation was started here:
- at op_net_accept_tcp ([WILDCARD])
- at Listener.accept ([WILDCARD])
- at testLeakTcpOps ([WILDCARD])
- at innerWrapped ([WILDCARD])
- at exitSanitizer ([WILDCARD])
- at outerWrapped ([WILDCARD])
-
- FAILURES
-
-testLeakTcpOps => [WILDCARD]/ops_sanitizer_tcp.ts:[WILDCARD]
-
-FAILED | 0 passed | 1 failed ([WILDCARD])
-
-error: Test failed
diff --git a/tests/testdata/test/sanitizer/ops_sanitizer_tcp.ts b/tests/testdata/test/sanitizer/ops_sanitizer_tcp.ts
deleted file mode 100644
index ec2df9fd5..000000000
--- a/tests/testdata/test/sanitizer/ops_sanitizer_tcp.ts
+++ /dev/null
@@ -1,4 +0,0 @@
-Deno.test(function testLeakTcpOps() {
- const listener1 = Deno.listen({ port: 0 });
- listener1.accept();
-});
diff --git a/tests/testdata/test/sanitizer/ops_sanitizer_timeout_failure.out b/tests/testdata/test/sanitizer/ops_sanitizer_timeout_failure.out
deleted file mode 100644
index e6e527112..000000000
--- a/tests/testdata/test/sanitizer/ops_sanitizer_timeout_failure.out
+++ /dev/null
@@ -1,6 +0,0 @@
-Check [WILDCARD]/ops_sanitizer_timeout_failure.ts
-running 1 test from [WILDCARD]/ops_sanitizer_timeout_failure.ts
-wait ... ok ([WILDCARD])
-
-ok | 1 passed | 0 failed ([WILDCARD])
-
diff --git a/tests/testdata/test/sanitizer/ops_sanitizer_timeout_failure.ts b/tests/testdata/test/sanitizer/ops_sanitizer_timeout_failure.ts
deleted file mode 100644
index d40a5a258..000000000
--- a/tests/testdata/test/sanitizer/ops_sanitizer_timeout_failure.ts
+++ /dev/null
@@ -1,22 +0,0 @@
-let intervalHandle: number;
-let firstIntervalPromise: Promise<void>;
-
-addEventListener("load", () => {
- firstIntervalPromise = new Promise((resolve) => {
- let firstIntervalCalled = false;
- intervalHandle = setInterval(() => {
- if (!firstIntervalCalled) {
- resolve();
- firstIntervalCalled = true;
- }
- }, 5);
- });
-});
-
-addEventListener("unload", () => {
- clearInterval(intervalHandle);
-});
-
-Deno.test("wait", async function () {
- await firstIntervalPromise;
-});
diff --git a/tests/testdata/test/sanitizer/ops_sanitizer_unstable.out b/tests/testdata/test/sanitizer/ops_sanitizer_unstable.out
deleted file mode 100644
index a09f34592..000000000
--- a/tests/testdata/test/sanitizer/ops_sanitizer_unstable.out
+++ /dev/null
@@ -1,22 +0,0 @@
-Check [WILDCARD]/ops_sanitizer_unstable.ts
-running 2 tests from [WILDCARD]/ops_sanitizer_unstable.ts
-no-op ... ok ([WILDCARD])
-leak interval ... FAILED ([WILDCARD])
-
- ERRORS
-
-leak interval => [WILDCARD]/ops_sanitizer_unstable.ts:[WILDCARD]
-error: Leaks detected:
- - An interval was started in this test, but never completed. This is often caused by not calling `clearInterval`. The operation was started here:
- at [WILDCARD]
- at setInterval ([WILDCARD])
- at fn ([WILDCARD]/ops_sanitizer_unstable.ts:[WILDCARD])
- at [WILDCARD]
-
- FAILURES
-
-leak interval => [WILDCARD]/ops_sanitizer_unstable.ts:[WILDCARD]
-
-FAILED | 1 passed | 1 failed ([WILDCARD])
-
-error: Test failed
diff --git a/tests/testdata/test/sanitizer/ops_sanitizer_unstable.ts b/tests/testdata/test/sanitizer/ops_sanitizer_unstable.ts
deleted file mode 100644
index 1deb1d5a7..000000000
--- a/tests/testdata/test/sanitizer/ops_sanitizer_unstable.ts
+++ /dev/null
@@ -1,10 +0,0 @@
-Deno.test("no-op", function () {});
-Deno.test({
- name: "leak interval",
- // regression test for sanitizer errors being swallowed with permissions.
- // https://github.com/denoland/deno/pull/18550
- permissions: {},
- fn() {
- setInterval(function () {}, 100000);
- },
-});
diff --git a/tests/testdata/test/sanitizer/resource_sanitizer.out b/tests/testdata/test/sanitizer/resource_sanitizer.out
deleted file mode 100644
index 128bbc7b6..000000000
--- a/tests/testdata/test/sanitizer/resource_sanitizer.out
+++ /dev/null
@@ -1,20 +0,0 @@
-Check [WILDCARD]/resource_sanitizer.ts
-running 1 test from [WILDCARD]/resource_sanitizer.ts
-leak ... FAILED ([WILDCARD])
-
- ERRORS
-
-leak => [WILDCARD]/resource_sanitizer.ts:[WILDCARD]
-error: Leaks detected:
-[UNORDERED_START]
- - The stdin pipe was opened before the test started, but was closed during the test. Do not close resources in a test that were not created during that test.
- - A file was opened during the test, but not closed during the test. Close the file handle by calling `file.close()`.
-[UNORDERED_END]
-
- FAILURES
-
-leak => [WILDCARD]/resource_sanitizer.ts:[WILDCARD]
-
-FAILED | 0 passed | 1 failed ([WILDCARD])
-
-error: Test failed
diff --git a/tests/testdata/test/sanitizer/resource_sanitizer.ts b/tests/testdata/test/sanitizer/resource_sanitizer.ts
deleted file mode 100644
index 93c9222c5..000000000
--- a/tests/testdata/test/sanitizer/resource_sanitizer.ts
+++ /dev/null
@@ -1,4 +0,0 @@
-Deno.test("leak", function () {
- Deno.openSync("run/001_hello.js");
- Deno.stdin.close();
-});
diff --git a/tests/testdata/test/sanitizer/trace_ops_caught_error/main.out b/tests/testdata/test/sanitizer/trace_ops_caught_error/main.out
deleted file mode 100644
index 4e591adf1..000000000
--- a/tests/testdata/test/sanitizer/trace_ops_caught_error/main.out
+++ /dev/null
@@ -1,6 +0,0 @@
-Check file:///[WILDCARD]/trace_ops_caught_error/main.ts
-running 1 test from [WILDCARD]/trace_ops_caught_error/main.ts
-handle thrown error in async function ... ok ([WILDCARD])
-
-ok | 1 passed | 0 failed ([WILDCARD])
-
diff --git a/tests/testdata/test/sanitizer/trace_ops_caught_error/main.ts b/tests/testdata/test/sanitizer/trace_ops_caught_error/main.ts
deleted file mode 100644
index 043018688..000000000
--- a/tests/testdata/test/sanitizer/trace_ops_caught_error/main.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-// https://github.com/denoland/deno/pull/16970
-Deno.test("handle thrown error in async function", async () => {
- const dirPath = Deno.makeTempDirSync();
- const filePath = `${dirPath}/file.txt`;
- try {
- await Deno.stat(filePath);
- } catch {
- await Deno.writeTextFile(filePath, "");
- } finally {
- await Deno.remove(filePath);
- await Deno.remove(dirPath);
- }
-});