Skip to content

Commit

Permalink
derp
Browse files Browse the repository at this point in the history
  • Loading branch information
fonsp committed May 16, 2024
1 parent 8f7decb commit d6d155d
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 6 deletions.
18 changes: 12 additions & 6 deletions src/packages/IOListener.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down
8 changes: 8 additions & 0 deletions test/compiletimes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -20,28 +20,35 @@ 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
sleep(0.1)
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)
Expand All @@ -54,3 +61,4 @@ HTTP.get("http://github.com")
HTTP.get("http://localhost:$port/edit").status == 200
server_task
end
@error "yay"
4 changes: 4 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
@@ -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")
Expand Down

0 comments on commit d6d155d

Please sign in to comment.