1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-22 15:06:54 -05:00

fix flaky tests by using exec in PTY tests (#8525)

This commit is contained in:
Ryan Dahl 2020-11-27 12:55:58 -05:00 committed by GitHub
parent 29374db11f
commit f60c80e1bd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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!()
}
}