Skip to content

HTTP(S) URLs on the standard ports (80/443) may be failing #158

Closed

Description

@bersbersbers

I don't have a reprex, but I believe that if you try to connect to an URL "https://host" (on port 443) which does not also answer on port 80, shinytest2 will think this app is not up because pieces$port is NULL and pingr::is_up defaults to port = 80 [which may be irrelevant if it's NULL already].

The same should be true for port 80.

shinytest2/R/httr.R

Lines 4 to 7 in 18dd006

pieces <- httr::parse_url(url)
if (!pingr::is_up(pieces$hostname, pieces$port)) {
app_abort(self, private, "Shiny app is no longer running")
}

Related: rstudio/shinytest@00e6df9 (via rstudio/shinytest#427)

Activity

  1. bersbersbers commented on Mar 31, 2022

    @bersbersbers
    ContributorAuthor

    It would by the way be nice if these two error messages were slightly different so one could tell which line of code it is from the error message:

    app_abort(self, private, "Shiny app is no longer running")

    app_abort(self, private, "Shiny app is no longer running", parent = e)

  2. changed the title [-]HTTPS URLs without explicit port may be failing unless backed by an HTTP server[/-] [+]HTTPS URLs without explicit port may be failing [unless backed by an HTTP server][/+] on Mar 31, 2022
  3. bersbersbers commented on Mar 31, 2022

    @bersbersbers
    ContributorAuthor

    The problem is aggravated by the fact that private$shiny_test_url is lacking the port if it's a standard port, even if it is was passed to the AppDriver, probably because it's received from Chrome via chromote, and Chrome does not display standard ports:

    private$shiny_test_url <- chromote_eval(
    self$get_chromote_session(),
    "Shiny.shinyapp.getTestSnapshotBaseUrl ? Shiny.shinyapp.getTestSnapshotBaseUrl({fullUrl:true}) : null"
    )$result$value

  4. changed the title [-]HTTPS URLs without explicit port may be failing [unless backed by an HTTP server][/-] [+]HTTP(S) URLs on the standard ports (80/443) may be failing[/+] on Mar 31, 2022
  5. bersbersbers commented on Mar 31, 2022

    @bersbersbers
    ContributorAuthor

    I tested that rstudio/shinytest@00e6df9 fixed the problem.

  6. schloerke commented on Apr 4, 2022

    @schloerke
    Collaborator

    @bersbersbers Thank you!

  7. added this to the v0.0.1 milestone on Apr 4, 2022
  8. added
    bug
    on Apr 4, 2022
  9. added a commit that references this issue on Apr 4, 2022
    2df8d3a
  10. added a commit that references this issue on Apr 5, 2022
    b6929ab
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

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions