temporalio / temporalio/sdk-typescript
[Bug] Test suite timeout on first run
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 917
- Forks
- 224
- Avg merge
- 3d 16h
- Merged PRs (30d)
- 43
Description
What are you really trying to do?
Running a unit test in either Jest / Mocha on a bad internet connection / not-so-nice proxy :)
Describe the bug
When running a unit test for the first time, it seems that the (latest?) SDK is being downloaded in the background first. The default timeout of mocha / Jest is like 2000ms, which is way less than the 20s timeout that is set for the download itself.
There is no informational message about this download being started, which would be a great debug starter.
In some cases, the download gets corrupted because of the abrupt interrupt. If you increase the jest / mocha timeout to >20s, you'll be able to spot the following message:
Failed to start ephemeral server: Temp download file at /var/folders/3w/4_q0ch0n763141t1zb61z_z80000gn/T/temporal-sdk-typescript-1.11.7.downloading not complete after 20 seconds. Make sure another download isn't running for too long and delete the temp file.
Minimal Reproduction
- Pull the 102 project, for example: https://github.com/temporalio/edu-102-typescript-code
- Remove the existing SDK if it already exists
npm iin any solution dir- Break your internet connection, or throttle it significantly
- Run the test suite for the first time
Without any indication about a download going on - you'll receive a jest / mocha timeout after 2000ms, indicating that some test did not complete.
Environment/Versions
- OS and processor: Mac M2
- Temporal Version: 1.11.7, temporal cli version 1.2.0 (I guess not relevant here, but putting it down anyways)
Additional context
My suggestion is to trigger an informational message, but only when the download is required of course. Would have been an immense timesaver for our team, as we are behind a very unfriendly proxy that will block the download every now and then, causing all tests to fail for no apparent reason :)
Thanks in advance!
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the first-run test behavior with Jest or Mocha under a slow or blocked connection, after removing the existing SDK. Trace the ephemeral-server SDK download and its 20-second timeout, then identify where a download-start message should appear. Done means required downloads are clearly reported and the existing failure behavior is covered by a test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- testing-qa
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100