Skip to content

Commit 2fc0ebd

Browse files
IanButterworthKristofferC
authored andcommitted
REPL: make interactive precompiles test more robust (#60006)
(cherry picked from commit a933cf4)
1 parent 8218435 commit 2fc0ebd

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

stdlib/REPL/test/precompilation.jl

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,18 @@ if !Sys.iswindows()
1818
# start an interactive session, ensuring `TERM` is unset since it can trigger
1919
# different amounts of precompilation stemming from `base/terminfo.jl` depending
2020
# on the value, making the test here unreliable
21-
cmd = addenv(`$(Base.julia_cmd()[1]) --trace-compile=$f -q --startup-file=no -i`,
21+
cmd = addenv(`$(Base.julia_cmd()) --trace-compile=$f -q --startup-file=no -i`,
2222
Dict("TERM" => ""))
2323
pts, ptm = open_fake_pty()
2424
p = run(cmd, pts, pts, pts; wait=false)
2525
Base.close_stdio(pts)
2626
std = readuntil(ptm, "julia>")
2727
# check for newlines instead of equality with "julia>" because color may be on
2828
occursin("\n", std) && @info "There was output before the julia prompt:\n$std"
29-
sleep(1) # sometimes precompiles output just after prompt appears
29+
@async write(ptm, "\n") # another prompt
30+
readuntil(ptm, "julia>")
31+
@async write(ptm, "\n") # another prompt
32+
readuntil(ptm, "julia>")
3033
tracecompile_out = read(f, String)
3134
close(ptm) # close after reading so we don't get precompiles from error shutdown
3235

0 commit comments

Comments
 (0)