From d6d155dc77aa5596fa028436dd82c1837769fbb7 Mon Sep 17 00:00:00 2001 From: Fons van der Plas Date: Thu, 16 May 2024 11:10:59 +0200 Subject: [PATCH] derp --- src/packages/IOListener.jl | 18 ++++++++++++------ test/compiletimes.jl | 8 ++++++++ test/runtests.jl | 4 ++++ 3 files changed, 24 insertions(+), 6 deletions(-) diff --git a/src/packages/IOListener.jl b/src/packages/IOListener.jl index 3743d041d8..8bc16878c1 100644 --- a/src/packages/IOListener.jl +++ b/src/packages/IOListener.jl @@ -14,16 +14,22 @@ end function trigger(listener::IOListener) if isreadable(listener.buffer) - @debug "waiting for data" - newdata = readavailable(listener.buffer) - @debug "making string" + #@debug "waiting for data" + newdata = try + readavailable(listener.buffer) + catch e + @warn "Error reading buffer" e + UInt8[] + end + + #@debug "making string" s = String(newdata) - @debug "making ansi" + #@debug "making ansi" ANSIEmulation.consume_safe!( listener.ansi_state, s ) - @debug "building string" s listener.ansi_state + #@debug "building string" s listener.ansi_state new_contents = ANSIEmulation.build_str(listener.ansi_state) listener.callback(new_contents) @@ -40,7 +46,7 @@ function startlistening(listener::IOListener) end end function stoplistening(listener::IOListener) - @debug "stopping listener" + #@debug "stopping listener" if listener.running[] listener.running[] = false trigger(listener) diff --git a/test/compiletimes.jl b/test/compiletimes.jl index eeddc1d5f3..baac44c587 100644 --- a/test/compiletimes.jl +++ b/test/compiletimes.jl @@ -20,6 +20,7 @@ let ) end @timeit TOUT "PlutoRunner.run_expression" @eval Pluto.PlutoRunner.run_expression(Foo, Expr(:toplevel, :(1 + 1)), test_notebook_id, uuid1(), nothing); +@error "yay" function wait_for_ready(notebook::Pluto.Notebook) while notebook.process_status != Pluto.ProcessStatus.ready @@ -27,21 +28,27 @@ function wait_for_ready(notebook::Pluto.Notebook) end end +@error "yay" 🍭 = Pluto.ServerSession() 🍭.options.server.disable_writing_notebook_files = true 🍭.options.evaluation.workspace_use_distributed = false path = joinpath(pkgdir(Pluto), "sample", "Basic.jl") +@error "yay" @timeit TOUT "SessionActions.open" nb = @eval Pluto.SessionActions.open(🍭, path; run_async=false) +@error "yay" wait_for_ready(nb) +@error "yay" Pluto.SessionActions.shutdown(🍭, nb; async=false) +@error "yay" # Compile HTTP get. Use no encoding since there seem to be an issue with Accept-Encoding: gzip HTTP.get("http://github.com") +@error "yay" @timeit TOUT "Pluto.run" server_task = @eval let port = 13435 options = Pluto.Configuration.from_flat_kwargs(; port, launch_browser=false, workspace_use_distributed=false, require_secret_for_access=false, require_secret_for_open_links=false) @@ -54,3 +61,4 @@ HTTP.get("http://github.com") HTTP.get("http://localhost:$port/edit").status == 200 server_task end +@error "yay" diff --git a/test/runtests.jl b/test/runtests.jl index 83b2bae1b1..8d86ac5ce8 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1,13 +1,17 @@ include("helpers.jl") # tests that start new processes: +@error "yay" @timeit_include("compiletimes.jl") +@error "yay" + verify_no_running_processes() if get(ENV, "PLUTO_TEST_ONLY_COMPILETIMES", nothing) == "true" print_timeroutput() exit(0) end +@error "yay" @timeit_include("Events.jl") verify_no_running_processes() @timeit_include("Configuration.jl")