winglang/wing

Add Timeout Parameter for Test Functions

Open

#2,594 建立於 2023年5月20日

在 GitHub 查看
 (5 留言) (0 反應) (0 負責人)TypeScript (214 fork)github user discovery
good first issue✨ enhancement🎨 sdk🧪 testing

倉庫指標

Star
 (5,385 star)
PR 合併指標
 (30 天內沒有已合併 PR)

描述

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

貢獻者指南