Skip to content
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

Updated timeout values; Add support for $new(timeout=); Drop CI support for $new(load_timeout=); Add option and envvar support for $new(load_timeout=, timeout=) #263

Merged
merged 14 commits into from
Sep 19, 2022

Conversation

schloerke
Copy link
Collaborator

@schloerke schloerke commented Sep 15, 2022

Fixes #213

  • Tests
  • News entry

@schloerke schloerke added this to the v0.2.0 milestone Sep 15, 2022
@schloerke schloerke marked this pull request as ready for review September 15, 2022 16:02
@schloerke schloerke requested review from gadenbuie and wch September 15, 2022 16:03
@schloerke
Copy link
Collaborator Author

I'm thinking we should scrap the timeout methods entirely and just make the startup time 10s and all other timeouts 4s.

The timeout defaults could be missing_arg() or getOption("shinytest2.timeout", 4 * 1000). If it is a missing_arg(), we could have it read the internal timeout value from AppDriver$new(timeout = XYZ). If not a missing_arg(), then there's no need for AppDriver$new(timeout = XYZ).

The AppDriver$new(load_timeout=) could default to getOption("shinytest2.load_timeout", 10 * 1000) instead of NULL to be explicit.


Then there's no confusion about CI... which value has been set... why the method name is about timeout, but arguments are about step or stepsize which doesn't immediately mean anything about timeouts.

Everything is just straight forward. Here's the timeout value.

@schloerke
Copy link
Collaborator Author

Original PR from {shinytest}: https://github.com/rstudio/shinytest/pull/335/files

I think the only motivation was for GHA to be able to load the shiny apps without having to set any parameters. I think I was wrong to take that motivation for all timeout values within the package

@schloerke
Copy link
Collaborator Author

schloerke commented Sep 15, 2022

Moving forward with something like

# Definition could be
app1 <- AppDriver$new(
  load_timeout = getOption("shinytest2.load_timeout", 10 * 1000),
  timeout = getOption("shinytest2.timeout", 4 * 1000)
)
# Definition could be
app1$run_js(timeout = missing_arg())
# Where
timeout <- rlang::maybe_missing(timeout, private$timeout)

  • Implement new approach
  • Drop new methods add in this PR

@gadenbuie
Copy link
Member

I think the only motivation was for GHA to be able to load the shiny apps without having to set any parameters.

For this motivation it might be worth adding an envvar lookup to the default value resolution, e.g. options → envvar → default value, since it's a lot easier to set the envvar in CI.

@schloerke schloerke changed the title Add $get_timeout(steps=), $set_timeout(stepsize=), and $new(timeout_stepsize=) Updated timeout values; Add support for $new(timeout=); Drop CI support for $new(load_timeout=); Add envvar support for $new(load_timeout=, timeout=) Sep 16, 2022
@schloerke schloerke requested review from gadenbuie and removed request for gadenbuie September 16, 2022 18:49
@schloerke schloerke changed the title Updated timeout values; Add support for $new(timeout=); Drop CI support for $new(load_timeout=); Add envvar support for $new(load_timeout=, timeout=) Updated timeout values; Add support for $new(timeout=); Drop CI support for $new(load_timeout=); Add option and envvar support for $new(load_timeout=, timeout=) Sep 16, 2022
Copy link
Member

@gadenbuie gadenbuie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! ⏲️ ⏳

@schloerke schloerke merged commit 956978a into main Sep 19, 2022
@schloerke schloerke deleted the app_timeout branch September 19, 2022 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Package option for wait_for_*() timeouts
2 participants