Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Error when running the tests in activities-examples #257

Open
redpanda opened this issue Mar 21, 2023 · 2 comments · Fixed by temporalio/sdk-typescript#1090
Open
Assignees
Labels
bug Something isn't working

Comments

@redpanda
Copy link
Contributor

What are you really trying to do?

When I run npm run jest in activities-examples I got some errors.

Describe the bug

activities-examples [main] npm run jest

> [email protected] jest
> jest

 PASS  src/activities/make-http-request.test.ts
2023-03-21T17:03:12.970538Z  INFO temporal_sdk_core::worker: Initializing worker task_queue=test namespace=default
2023-03-21T17:03:13.041052Z  WARN complete_workflow_activation: temporal_sdk_core::worker::workflow: Failing workflow task run_id=7d1980b6-4e96-446c-a461-5e886214ae42 failure=Failure { failure: Some(Failure { message: "Unexpected token u in JSON at position 0", source: "TypeScriptSDK", stack_trace: "undefined:1\nundefined\n^\n\nSyntaxError: Unexpected token u in JSON at position 0\n    at JSON.parse (<anonymous>)\n    at Object.concludeActivation (/Users/jleger/Projects/temporal/samples-typescript/activities-examples/node_modules/@temporalio/nyc-test-coverage/src/interceptors.ts:16:28)\n    at next (/Users/jleger/Projects/temporal/samples-typescript/activities-examples/node_modules/@temporalio/common/src/interceptors.ts:29:59)\n    at Object.concludeActivation (/Users/jleger/Projects/temporal/samples-typescript/activities-examples/node_modules/@temporalio/workflow/src/worker-interface.ts:238:23)\n    at evalmachine.<anonymous>:1:18", encoded_attributes: None, cause: None, failure_info: None }) } completion=WorkflowActivationCompletion(run_id: 7d1980b6-4e96-446c-a461-5e886214ae42, status: Failed) run_id=7d1980b6-4e96-446c-a461-5e886214ae42 task_queue=test workflow_id="0005999d-a077-46ce-b217-5bd02381856f"
 FAIL  src/workflows.test.ts (8.694 s)
  ● Console

    console.log
      [ERROR] Failed to activate workflow

      at DefaultLogger.worker_1.Runtime.install.logger [as logFunction] (src/workflows.test.ts:15:68)

    console.log
      [ERROR] Failed to activate workflow

      at DefaultLogger.worker_1.Runtime.install.logger [as logFunction] (src/workflows.test.ts:15:68)

  ● httpWorkflow with mock activity

    thrown: "Exceeded timeout of 5000 ms for a test.
    Use jest.setTimeout(newTimeout) to increase the timeout value, if this is a long-running test."

      27 | });
      28 |
    > 29 | test('httpWorkflow with mock activity', async () => {
         | ^
      30 |   const { client, nativeConnection } = testEnv;
      31 |   const worker = await Worker.create(
      32 |     workflowCoverage.augmentWorkerOptions({

      at Object.<anonymous> (src/workflows.test.ts:29:1)


  ● Test suite failed to run

    IllegalStateError: Cannot close connection while Workers hold a reference to it

      20 |
      21 | afterAll(async () => {
    > 22 |   await testEnv?.teardown();
         |   ^
      23 | });
      24 |
      25 | afterAll(() => {

      at NativeConnection.close (node_modules/@temporalio/worker/src/connection.ts:65:13)
      at TestWorkflowEnvironment.teardown (node_modules/@temporalio/testing/src/index.ts:292:33)
      at Object.<anonymous> (src/workflows.test.ts:22:3)

Minimal Reproduction

cd activities-examples
npm run jest

Environment/Versions

  • OS and processor: Intel Mac
  • Temporal Version: SDK 1.6.0
  • Are you using Docker or Kubernetes or building Temporal from source? No

Additional context

@zijianzz
Copy link

zijianzz commented Apr 6, 2023

@mjameswh Hello I just test this issue with 1.7.0, I saw the same issue

@acheong08
Copy link

acheong08 commented Apr 8, 2024

Hi. I'm currently experiencing the same error on the hello-world folder and temporal-activities-examples@ as well. On 1.9.0

@mjameswh mjameswh reopened this May 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants