-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
hanging on local app wait_for_shiny_ready when headless #6
Comments
Is it still an issue? |
no. this seems to have been resolved. thnx |
this is happening again test <- crrry::CrrryProc$new(
chrome_bin = pagedown::find_chrome(),
shiny_port = httpuv::randomPort(),
chrome_port = httpuv::randomPort(),
fun = "puzzlemath::run_app()",
pre_launch_cmd = glue::glue("whereami::set_whereami_log('{tempdir()}')"),
headless = TRUE
)
test$wait_for_shiny_ready() session info─ Session info ────────────────────────────────────────────────────────────────
setting value
version R version 3.6.3 (2020-02-29)
os macOS Catalina 10.15.7
system x86_64, darwin15.6.0
ui RStudio
language (EN)
collate en_US.UTF-8
ctype en_US.UTF-8
tz America/New_York
date 2020-12-11
─ Packages ────────────────────────────────────────────────────────────────────
package * version date lib source
askpass 1.1 2019-01-13 [1] CRAN (R 3.6.0)
assertthat 0.2.1 2019-03-21 [1] CRAN (R 3.6.0)
attempt 0.3.1 2020-05-03 [1] CRAN (R 3.6.2)
binman 0.1.1 2018-07-18 [1] CRAN (R 3.6.0)
bitops 1.0-6 2013-08-17 [1] CRAN (R 3.6.0)
caTools 1.18.0 2020-01-17 [1] CRAN (R 3.6.0)
cli 2.2.0 2020-11-20 [1] CRAN (R 3.6.2)
clipr 0.7.1 2020-10-08 [1] CRAN (R 3.6.2)
crayon 1.3.4 2017-09-16 [1] CRAN (R 3.6.0)
crrri 0.0.13 2020-09-28 [1] Github (rlesur/crrri@8cc6ce1)
crrry 0.0.0.9001 2020-12-08 [1] Github (colinfay/crrry@cb56e76)
curl 4.3 2019-12-02 [1] CRAN (R 3.6.0)
debugme 1.1.0 2017-10-22 [1] CRAN (R 3.6.0)
desc 1.2.0.9000 2020-09-28 [1] Github (r-lib/desc@c175259)
details 0.2.1 2020-01-12 [1] local
digest 0.6.27 2020-10-24 [1] CRAN (R 3.6.2)
fansi 0.4.1 2020-01-08 [1] CRAN (R 3.6.0)
fastmap 1.0.1 2019-10-08 [1] CRAN (R 3.6.0)
glue 1.4.2 2020-08-27 [1] CRAN (R 3.6.2)
here 1.0.0.9000 2020-11-25 [1] Github (r-lib/here@fdd23b1)
htmltools 0.5.0 2020-06-16 [1] CRAN (R 3.6.2)
httpuv 1.5.4 2020-06-06 [1] CRAN (R 3.6.2)
httr 1.4.2 2020-07-20 [1] CRAN (R 3.6.2)
jsonlite 1.7.1 2020-09-07 [1] CRAN (R 3.6.2)
knitr 1.30 2020-09-22 [1] CRAN (R 3.6.2)
later 1.1.0.9000 2020-11-25 [1] Github (r-lib/later@0cfd3b5)
magrittr 2.0.1 2020-11-17 [1] CRAN (R 3.6.2)
mime 0.9 2020-02-04 [1] CRAN (R 3.6.0)
openssl 1.4.3 2020-09-18 [1] CRAN (R 3.6.2)
pagedown 0.9 2020-03-18 [1] CRAN (R 3.6.0)
png 0.1-7 2013-12-03 [1] CRAN (R 3.6.0)
processx 3.4.5 2020-11-30 [1] CRAN (R 3.6.2)
promises 1.1.1.9001 2020-11-25 [1] Github (rstudio/promises@bbadb3d)
ps 1.5.0 2020-12-05 [1] CRAN (R 3.6.2)
purrr 0.3.4 2020-04-17 [1] CRAN (R 3.6.2)
R6 2.5.0 2020-10-28 [1] CRAN (R 3.6.2)
rappdirs 0.3.1 2016-03-28 [1] CRAN (R 3.6.0)
Rcpp 1.0.5 2020-07-06 [1] CRAN (R 3.6.2)
reactor 0.0.8 2020-12-08 [1] local
rlang 0.4.9 2020-11-26 [1] CRAN (R 3.6.2)
rprojroot 2.0.2 2020-11-25 [1] Github (r-lib/rprojroot@5bafca9)
RSelenium 1.7.7 2020-02-03 [1] CRAN (R 3.6.1)
rstudioapi 0.13 2020-11-12 [1] CRAN (R 3.6.2)
semver 0.2.0 2017-01-06 [1] CRAN (R 3.6.0)
sessioninfo 1.1.1 2018-11-05 [1] CRAN (R 3.6.0)
shiny 1.5.0 2020-06-23 [1] CRAN (R 3.6.2)
shinyjs 1.0 2018-01-08 [1] CRAN (R 3.6.0)
testthat 3.0.0 2020-10-31 [1] CRAN (R 3.6.2)
wdman 0.2.5 2020-01-31 [1] CRAN (R 3.6.0)
websocket 1.3.1 2020-07-13 [1] CRAN (R 3.6.2)
whereami 0.1.9 2020-09-24 [1] local
withr 2.3.0 2020-09-22 [1] CRAN (R 3.6.2)
xfun 0.19 2020-10-30 [1] CRAN (R 3.6.2)
XML 3.98-1.20 2019-06-06 [1] CRAN (R 3.6.0)
xml2 1.3.2 2020-04-23 [1] CRAN (R 3.6.2)
xtable 1.8-4 2019-04-21 [1] CRAN (R 3.6.0)
[1] /Library/Frameworks/R.framework/Versions/3.6/Resources/library
|
@yonicd : were you able to solve it? It got the same issue. It is running well locally but get stuck on GitLab CI/CD. |
I believe part of the problem is here:https://github.com/ColinFay/crrry/blob/cb56e7656ec0d231c2aeccba5bf66180c33ccb50/R/launch.R#L240 Below is the hacked R6 class I am using: CrrryProcCustom <- R6::R6Class(
"CrrryProcCustom",
inherit = crrry::CrrryProc,
public = list(
stop = function() {
private$chrome$close()
message("Chrome closed")
self$process$kill()
message("Process killed")
},
initialize = function(
chrome_bin = Sys.getenv("HEADLESS_CHROME"),
fun = "pkgload::load_all();run_app()",
shiny_port = 2811L,
chrome_port = 9222L,
headless = TRUE,
pre_launch_cmd = "",
...
){
private$stdout_ <- tempfile()
private$stderr_ <- tempfile()
attempt::stop_if(
pre_launch_cmd,
is.null,
'pre_launch_cmd can not be NULL. If you want it empty, use `""` (the default).'
)
self$process <- processx::process$new(
"Rscript", c(
"-e",
sprintf(
"options(shiny.port = %s, shiny.launch.browser = invisible);%s;%s",
shiny_port, pre_launch_cmd, fun
)
),
stderr = private$stderr_,
stdout = private$stdout_
)
# It seems that Shiny need a lot of time to load properly
Sys.sleep(5)
attempt::stop_if_not(
self$process$is_alive(),
msg = "Unable to launch the Shiny App"
)
private$chrome <- crrri::Chrome$new(
chrome_bin,
debug_port = chrome_port,
headless = headless,
...
)
private$client <- crrri::hold(
private$chrome$connect()
)
private$Page <- private$client$Page
private$Runtime <- private$client$Runtime
crrri::hold({
private$client$Page$navigate(
url = sprintf(
"http://127.0.0.1:%s",
shiny_port
)
)
})
}
)
) |
local:
remote:
Chrome Version
85.0.4183.121 (Official Build) beta (64-bit)
session info
The text was updated successfully, but these errors were encountered: