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 i
in 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!