From f60c80e1bd02b18f37b6c7b270bdbd3eac27a124 Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Fri, 27 Nov 2020 12:55:58 -0500 Subject: fix flaky tests by using exec in PTY tests (#8525) --- cli/tests/integration_tests.rs | 30 ++++++++++-------------------- 1 file changed, 10 insertions(+), 20 deletions(-) (limited to 'cli') 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!() } } -- cgit v1.2.3