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

Specify timeout for runShell commands #122

Closed
JakeSCahill opened this issue Apr 3, 2024 · 2 comments
Closed

Specify timeout for runShell commands #122

JakeSCahill opened this issue Apr 3, 2024 · 2 comments
Assignees
Labels
enhancement New feature or request request Request from user

Comments

@JakeSCahill
Copy link
Sponsor Contributor

runShell commands execute shell commands as part of test scenarios. However, some commands may enter a state where they wait indefinitely for input or a specific condition that does not occur, leading to stalled test executions. This behavior impacts the overall testing workflow, especially in CI/CD environments where automated tests are expected to run to completion within a reasonable timeframe.

Proposed solution
Introduce an optional timeout parameter for runShell test actions. This parameter defines a maximum duration (in seconds) for a test to run. If the command does not complete within the specified timeout, it will be automatically terminated, and the test will proceed based on the predefined failure handling strategy.

// (step {"action":"runShell", "command": "some-long-running-command", "timeout": 60})

Benefits

  • Prevents tests from hanging indefinitely.

  • Allows test writers to fine-tune the execution behavior of shell commands based on their understanding of the command's expected duration and behavior.

  • Reduces the risk of stalled pipeline executions due to hanging tests, contributing to more predictable and efficient CI/CD workflows.

@hawkeyexl hawkeyexl added the enhancement New feature or request label Apr 3, 2024
@hawkeyexl hawkeyexl self-assigned this Apr 3, 2024
@hawkeyexl
Copy link
Contributor

Accepted. Timeout will likely be in milliseconds to match other timeout/duration parameters in other actions, but the schema matches otherwise.

@hawkeyexl hawkeyexl transferred this issue from doc-detective/doc-detective Apr 19, 2024
@hawkeyexl hawkeyexl added the request Request from user label Apr 21, 2024
@hawkeyexl
Copy link
Contributor

Will be available in v2.14.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request request Request from user
Projects
None yet
Development

No branches or pull requests

2 participants