winglang/wing

Add Timeout Parameter for Test Functions

Open

#2594 aperta il 20 mag 2023

Vedi su GitHub
 (5 commenti) (0 reazioni) (0 assegnatari)TypeScript (214 fork)github user discovery
good first issue✨ enhancement🎨 sdk🧪 testing

Metriche repository

Star
 (5385 star)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

Feature Spec

  • The system should allow developers to set a custom timeout value for test functions.
  • The system should throw an exception if the timeout value is not of the appropriate format or type.
  • The default timeout value should remain as it is currently if no custom value is provided.
  • Proper error messages should be displayed in case the timeout value is exceeded during test execution.

Use Cases

Currently, while it's possible to set a timeout for cloud.Function, there seems to be no such functionality for tests. This feature is potentially beneficial for testing scenarios where there might be long-running processes, hence the need to customize the timeout value to avoid premature termination.

queue.addConsumer(inflight (message: str) => {
  bucket.put("wing.txt", "Hello, ${message}");
}, timeout: 1s);

There's no equivalent for tests.

Implementation Notes

No response

Component

Language Design

Community Notes

  • Please vote by adding a 👍 reaction to the issue to help us prioritize.
  • If you are interested to work on this issue, please leave a comment.

https://winglang.slack.com/archives/C047QFSUL5R/p1684582715846209

Guida contributor