winglang/wing

Add Timeout Parameter for Test Functions

Open

#2.594 aberto em 20 de mai. de 2023

Ver no GitHub
 (5 comments) (0 reactions) (0 assignees)TypeScript (214 forks)github user discovery
good first issue✨ enhancement🎨 sdk🧪 testing

Métricas do repositório

Stars
 (5.385 stars)
Métricas de merge de PR
 (Nenhuma PRs mesclada em 30d)

Description

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

Guia do colaborador