temporalio / samples-typescript

Other
324 stars 126 forks source link

[Bug] Mocha times out (no matter the timeout set) #357

Closed acheong08 closed 7 months ago

acheong08 commented 7 months ago

What are you really trying to do?

Run npm test on hello-world

Describe the bug

$ mocha --exit --require ts-node/register --require source-map-support/register src/mocha/*.test.ts

  greet activity
    ✓ successfully greets the user

  Example workflow with mocks
    1) "before all" hook for "successfully completes the Workflow with a mocked Activity"

  Example workflow
    2) "before all" hook for "successfully completes the Workflow"

  1 passing (12s)
  2 failing

  1) Example workflow with mocks
       "before all" hook for "successfully completes the Workflow with a mocked Activity":
     Error: Timeout of 2000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (/home/acheong/Projects/skand/v2/samples-typescript/hello-world/src/mocha/workflows-mocks.test.ts)
      at listOnTimeout (node:internal/timers:573:17)
      at processTimers (node:internal/timers:514:7)

  2) Example workflow
       "before all" hook for "successfully completes the Workflow":
     Error: Timeout of 10000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (/home/acheong/Projects/skand/v2/samples-typescript/hello-world/src/mocha/workflows.test.ts)
      at listOnTimeout (node:internal/timers:573:17)
      at processTimers (node:internal/timers:514:7)

Minimal Reproduction

$ git clone https://github.com/temporalio/samples-typescript

$ cd hello-world

$ npm i

$ npm test

Environment/Versions

acheong08 commented 7 months ago

Looks like it's an issue of the first run:

Failed to start ephemeral server: Temp download file at /tmp/temporal-sdk-typescript-1.9.3.downloading not complete after 20 seconds. Make sure another download isn't running for too long and delete the temp file.

Depends on internet speed. How do I pre-fetch this?

acheong08 commented 7 months ago
$ rm /tmp/temporal-sdk-typescript-1.9.3.downloading

Set timeout to a very long time, run again, then set the timeout back to a reasonable value.