diff options
Diffstat (limited to 'tests/integration/watcher_tests.rs')
-rw-r--r-- | tests/integration/watcher_tests.rs | 95 |
1 files changed, 32 insertions, 63 deletions
diff --git a/tests/integration/watcher_tests.rs b/tests/integration/watcher_tests.rs index 7864938f8..bb757eb35 100644 --- a/tests/integration/watcher_tests.rs +++ b/tests/integration/watcher_tests.rs @@ -192,8 +192,7 @@ fn child_lines( (stdout_lines, stderr_lines) } -#[flaky_test] -#[tokio::main] +#[flaky_test(tokio)] async fn lint_watch_test() { let t = TempDir::new(); let badly_linted_original = @@ -248,8 +247,7 @@ async fn lint_watch_test() { child.kill().unwrap(); } -#[flaky_test] -#[tokio::main] +#[flaky_test(tokio)] async fn lint_watch_without_args_test() { let t = TempDir::new(); let badly_linted_original = @@ -304,8 +302,7 @@ async fn lint_watch_without_args_test() { drop(t); } -#[flaky_test] -#[tokio::main] +#[flaky_test(tokio)] async fn lint_all_files_on_each_change_test() { let t = TempDir::new(); let badly_linted_fixed0 = @@ -349,8 +346,7 @@ async fn lint_all_files_on_each_change_test() { drop(t); } -#[flaky_test] -#[tokio::main] +#[flaky_test(tokio)] async fn fmt_watch_test() { let fmt_testdata_path = util::testdata_path().join("fmt"); let t = TempDir::new(); @@ -405,8 +401,7 @@ async fn fmt_watch_test() { check_alive_then_kill(child); } -#[flaky_test] -#[tokio::main] +#[flaky_test(tokio)] async fn fmt_watch_without_args_test() { let fmt_testdata_path = util::testdata_path().join("fmt"); let t = TempDir::new(); @@ -458,8 +453,7 @@ async fn fmt_watch_without_args_test() { check_alive_then_kill(child); } -#[flaky_test] -#[tokio::main] +#[flaky_test(tokio)] async fn fmt_check_all_files_on_each_change_test() { let t = TempDir::new(); let fmt_testdata_path = util::testdata_path().join("fmt"); @@ -498,8 +492,7 @@ async fn fmt_check_all_files_on_each_change_test() { check_alive_then_kill(child); } -#[flaky_test] -#[tokio::main] +#[flaky_test(tokio)] async fn bundle_js_watch() { use std::path::PathBuf; // Test strategy extends this of test bundle_js by adding watcher @@ -573,8 +566,7 @@ async fn bundle_js_watch() { } /// Confirm that the watcher continues to work even if module resolution fails at the *first* attempt -#[flaky_test] -#[tokio::main] +#[flaky_test(tokio)] async fn bundle_watch_not_exit() { let t = TempDir::new(); let file_to_watch = t.path().join("file_to_watch.ts"); @@ -637,8 +629,7 @@ async fn bundle_watch_not_exit() { check_alive_then_kill(deno); } -#[flaky_test] -#[tokio::main] +#[flaky_test(tokio)] async fn run_watch_no_dynamic() { let t = TempDir::new(); let file_to_watch = t.path().join("file_to_watch.js"); @@ -720,8 +711,7 @@ async fn run_watch_no_dynamic() { // if that's because of a bug in code or the runner itself. We should reenable // it once we upgrade to XL runners for macOS. #[cfg(not(target_os = "macos"))] -#[flaky_test] -#[tokio::main] +#[flaky_test(tokio)] async fn run_watch_external_watch_files() { let t = TempDir::new(); let file_to_watch = t.path().join("file_to_watch.js"); @@ -764,8 +754,7 @@ async fn run_watch_external_watch_files() { check_alive_then_kill(child); } -#[flaky_test] -#[tokio::main] +#[flaky_test(tokio)] async fn run_watch_load_unload_events() { let t = TempDir::new(); let file_to_watch = t.path().join("file_to_watch.js"); @@ -828,8 +817,7 @@ async fn run_watch_load_unload_events() { } /// Confirm that the watcher continues to work even if module resolution fails at the *first* attempt -#[flaky_test] -#[tokio::main] +#[flaky_test(tokio)] async fn run_watch_not_exit() { let t = TempDir::new(); let file_to_watch = t.path().join("file_to_watch.js"); @@ -862,8 +850,7 @@ async fn run_watch_not_exit() { check_alive_then_kill(child); } -#[flaky_test] -#[tokio::main] +#[flaky_test(tokio)] async fn run_watch_with_import_map_and_relative_paths() { fn create_relative_tmp_file( directory: &TempDir, @@ -916,8 +903,7 @@ async fn run_watch_with_import_map_and_relative_paths() { check_alive_then_kill(child); } -#[flaky_test] -#[tokio::main] +#[flaky_test(tokio)] async fn run_watch_with_ext_flag() { let t = TempDir::new(); let file_to_watch = t.path().join("file_to_watch"); @@ -953,8 +939,7 @@ async fn run_watch_with_ext_flag() { check_alive_then_kill(child); } -#[flaky_test] -#[tokio::main] +#[flaky_test(tokio)] async fn run_watch_error_messages() { let t = TempDir::new(); let file_to_watch = t.path().join("file_to_watch.js"); @@ -984,8 +969,7 @@ async fn run_watch_error_messages() { check_alive_then_kill(child); } -#[flaky_test] -#[tokio::main] +#[flaky_test(tokio)] async fn test_watch_basic() { let t = TempDir::new(); @@ -1140,8 +1124,7 @@ async fn test_watch_basic() { check_alive_then_kill(child); } -#[flaky_test] -#[tokio::main] +#[flaky_test(tokio)] async fn test_watch_doc() { let t = TempDir::new(); @@ -1189,8 +1172,7 @@ async fn test_watch_doc() { check_alive_then_kill(child); } -#[flaky_test] -#[tokio::main] +#[flaky_test(tokio)] async fn test_watch_module_graph_error_referrer() { let t = TempDir::new(); let file_to_watch = t.path().join("file_to_watch.js"); @@ -1218,8 +1200,7 @@ async fn test_watch_module_graph_error_referrer() { } // Regression test for https://github.com/denoland/deno/issues/15428. -#[flaky_test] -#[tokio::main] +#[flaky_test(tokio)] async fn test_watch_unload_handler_error_on_drop() { let t = TempDir::new(); let file_to_watch = t.path().join("file_to_watch.js"); @@ -1249,8 +1230,7 @@ async fn test_watch_unload_handler_error_on_drop() { check_alive_then_kill(child); } -#[flaky_test] -#[tokio::main] +#[flaky_test(tokio)] async fn run_watch_blob_urls_reset() { let _g = util::http_server(); let t = TempDir::new(); @@ -1291,8 +1271,7 @@ async fn run_watch_blob_urls_reset() { } #[cfg(unix)] -#[flaky_test] -#[tokio::main] +#[flaky_test(tokio)] async fn test_watch_sigint() { use nix::sys::signal; use nix::sys::signal::Signal; @@ -1317,8 +1296,7 @@ async fn test_watch_sigint() { assert_eq!(exit_status.code(), Some(130)); } -#[flaky_test] -#[tokio::main] +#[flaky_test(tokio)] async fn bench_watch_basic() { let t = TempDir::new(); @@ -1431,8 +1409,7 @@ async fn bench_watch_basic() { } // Regression test for https://github.com/denoland/deno/issues/15465. -#[flaky_test] -#[tokio::main] +#[flaky_test(tokio)] async fn run_watch_reload_once() { let _g = util::http_server(); let t = TempDir::new(); @@ -1470,8 +1447,7 @@ async fn run_watch_reload_once() { /// Regression test for https://github.com/denoland/deno/issues/18960. Ensures that Deno.serve /// operates properly after a watch restart. -#[flaky_test] -#[tokio::main] +#[flaky_test(tokio)] async fn test_watch_serve() { let t = TempDir::new(); let file_to_watch = t.path().join("file_to_watch.js"); @@ -1507,8 +1483,7 @@ async fn test_watch_serve() { check_alive_then_kill(child); } -#[flaky_test] -#[tokio::main] +#[flaky_test(tokio)] async fn run_watch_dynamic_imports() { let t = TempDir::new(); let file_to_watch = t.path().join("file_to_watch.js"); @@ -1594,8 +1569,7 @@ async fn run_watch_dynamic_imports() { check_alive_then_kill(child); } -#[flaky_test] -#[tokio::main] +#[flaky_test(tokio)] async fn run_watch_inspect() { let t = TempDir::new(); let file_to_watch = t.path().join("file_to_watch.js"); @@ -1636,8 +1610,7 @@ async fn run_watch_inspect() { check_alive_then_kill(child); } -#[flaky_test] -#[tokio::main] +#[flaky_test(tokio)] async fn run_watch_with_excluded_paths() { let t = TempDir::new(); @@ -1676,8 +1649,7 @@ async fn run_watch_with_excluded_paths() { check_alive_then_kill(child); } -#[flaky_test] -#[tokio::main] +#[flaky_test(tokio)] async fn run_hmr_server() { let t = TempDir::new(); let file_to_watch = t.path().join("file_to_watch.js"); @@ -1750,8 +1722,7 @@ console.log("Listening...") check_alive_then_kill(child); } -#[flaky_test] -#[tokio::main] +#[flaky_test(tokio)] async fn run_hmr_jsx() { let t = TempDir::new(); let file_to_watch = t.path().join("file_to_watch.js"); @@ -1762,7 +1733,7 @@ import { foo } from "./foo.jsx"; let i = 0; setInterval(() => { console.log(i++, foo()); -}, 100); +}, 100); "#, ); let file_to_watch2 = t.path().join("foo.jsx"); @@ -1806,8 +1777,7 @@ export function foo() { check_alive_then_kill(child); } -#[flaky_test] -#[tokio::main] +#[flaky_test(tokio)] async fn run_hmr_uncaught_error() { let t = TempDir::new(); let file_to_watch = t.path().join("file_to_watch.js"); @@ -1867,8 +1837,7 @@ export function foo() { check_alive_then_kill(child); } -#[flaky_test] -#[tokio::main] +#[flaky_test(tokio)] async fn run_hmr_unhandled_rejection() { let t = TempDir::new(); let file_to_watch = t.path().join("file_to_watch.js"); |