diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2020-11-27 12:55:58 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-27 12:55:58 -0500 |
commit | f60c80e1bd02b18f37b6c7b270bdbd3eac27a124 (patch) | |
tree | 5c06d5106a220b170d82c7c18843ac2473af5674 /cli/tests | |
parent | 29374db11fdadd7ec6271cc05de29039fcc02f87 (diff) |
fix flaky tests by using exec in PTY tests (#8525)
Diffstat (limited to 'cli/tests')
-rw-r--r-- | cli/tests/integration_tests.rs | 30 |
1 files changed, 10 insertions, 20 deletions
diff --git a/cli/tests/integration_tests.rs b/cli/tests/integration_tests.rs index e57b682c5..dc225e6fd 100644 --- a/cli/tests/integration_tests.rs +++ b/cli/tests/integration_tests.rs @@ -1451,8 +1451,7 @@ fn run_watch_fail() { fn repl_test_pty_multiline() { use std::io::Read; use util::pty::fork::*; - - let tests_path = util::tests_path(); + let deno_exe = util::deno_exe_path(); let fork = Fork::from_ptmx().unwrap(); if let Ok(mut master) = fork.is_parent() { master.write_all(b"(\n1 + 2\n)\n").unwrap(); @@ -1485,14 +1484,10 @@ fn repl_test_pty_multiline() { fork.wait().unwrap(); } else { - util::deno_cmd() - .current_dir(tests_path) - .env("NO_COLOR", "1") - .arg("repl") - .spawn() - .unwrap() - .wait() - .unwrap(); + std::env::set_var("NO_COLOR", "1"); + let err = exec::Command::new(deno_exe).arg("repl").exec(); + println!("err {}", err); + unreachable!() } } @@ -1501,8 +1496,7 @@ fn repl_test_pty_multiline() { fn repl_test_pty_unpaired_braces() { use std::io::Read; use util::pty::fork::*; - - let tests_path = util::tests_path(); + let deno_exe = util::deno_exe_path(); let fork = Fork::from_ptmx().unwrap(); if let Ok(mut master) = fork.is_parent() { master.write_all(b")\n").unwrap(); @@ -1519,14 +1513,10 @@ fn repl_test_pty_unpaired_braces() { fork.wait().unwrap(); } else { - util::deno_cmd() - .current_dir(tests_path) - .env("NO_COLOR", "1") - .arg("repl") - .spawn() - .unwrap() - .wait() - .unwrap(); + std::env::set_var("NO_COLOR", "1"); + let err = exec::Command::new(deno_exe).arg("repl").exec(); + println!("err {}", err); + unreachable!() } } |