Skip to content

[Feature]: Add timeout parameter to create_app_fixture #2032

@evanglass

Description

@evanglass

Category

Testing

Scope

Minor Enhancement

Problem

Currently, apps which take too long to start up (e.g. apps which load large data objects on startup or use packages like rpy2) can fail with the message "TimeoutError: Timeout while waiting for Shiny app to become ready". This is due to the timeout duration being hardcoded to just 30 seconds.

Solution

The feature would add a timeout_secs parameter like that in run_shiny_app. This parameter would be passed into the shiny_app_gen calls.

Alternatives (Optional)

No response

Example (Optional)

from playwright.sync_api import Page

from shiny.playwright import controller
from shiny.pytest import create_app_fixture
from shiny.run import ShinyAppProc

app = create_app_fixture("relative/path/to/app.py", timeout_secs=60)

def test_app_code(page: Page, app: ShinyAppProc):

    page.goto(app.url)
    # Add test code here
    ...

Impact (Optional)

No response

Contribution? (Optional)

Yes, I can implement (or help).

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions