Skip to content

Obscure error with covr::package_coverage #392

Closed

Description

@LouisLeNezet

Hi,

I'm developping a R package with a shiny application embedded in it and I use shinytest2 for my unit test of the shiny app and shiny modules.
This was working fine on R 4.3 but now that I'm trying to make it work with R4.4 I get the following error:

{shinytest2} R info   10:43:23.50 Error while initializing AppDriver:
                                  Cannot find shiny port number. Error lines found:
                                  Loading required package: shiny
{shiny}      R stderr ----------- Loading required package: shiny

Even after simplifying testthat.R to simply test one small app, the error is still present.
Even stanger, this only happen if the app is declared in the package and disappear if I create it in the testthat.R file.
It does not happen on windows and only on linux.

Do you know where does it come from and how I could solve it ?

Activity

  1. LouisLeNezet commented on Oct 2, 2024

    @LouisLeNezet
    ContributorAuthor

    After debugging, and lookinf into shinytest2 code it seems that the Cannot find shiny port number is due to reaching the maximum load_timeout. By increasing it to 60sec the error disappear.
    It could be nice to have a more explicit error 😄

  2. gadenbuie commented on Oct 2, 2024

    @gadenbuie
    Member

    Thanks for the suggestion! For completeness (or if you want to propose changes in a PR) the error message comes from

    if (i == max_i) {
    app_abort(self, private, paste0(
    "Cannot find shiny port number. Error lines found:\n",
    paste(err_lines, collapse = "\n")
    ))
    }

  3. LouisLeNezet commented on Oct 2, 2024

    @LouisLeNezet
    ContributorAuthor

    Done in #393

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions