temporalio / temporalio/samples-typescript

[Bug] gRPC Connection Refused when executing Workflows in tests

Open
#361 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
TypeScript
Stars
465
Forks
148
Avg merge
1d 10h
Merged PRs (30d)
11

Description

What are you really trying to do?

I am trying to test executing my Temporal workflows with the @temporalio/testing package.

Describe the bug

Whenever I try to execute a workflow with the testing library (TestWorkflowEnvironment), I see a gRPC error saying that the connection was refused.

I believe this issue surfaced today, as my tests were working up until yesterday, and no changes were made on my end.

Minimal Reproduction

You can reproduce the issue with this repo's example tests in activities-examples/src/mocha.

Steps:

  • Fresh clone of this repo
  • cd activities-examples
  • npm install
  • npm test

Tests error with gRPC Connection Refused

$ git clone https://github.com/temporalio/samples-typescript
$ cd samples-typescript/activities-examples
$ npm install
$ npm test


> temporal-activities-examples@0.1.0 test
> mocha --require ts-node/register --require source-map-support/register src/mocha/*.test.ts



  example workflow
2024-04-29T21:38:36.476892Z  WARN temporal_client::retry: gRPC call poll_activity_task_queue retried 6 times error=Status { code: Unavailable, message: "error trying to connect: tcp connect error: Connection refused (os error 61)", source: Some(tonic::transport::Error(Transport, hyper::Error(Connect, ConnectError("tcp connect error", Os { code: 61, kind: ConnectionRefused, message: "Connection refused" })))) }
2024-04-29T21:38:36.759551Z  WARN temporal_client::retry: gRPC call poll_activity_task_queue retried 6 times error=Status { code: Unavailable, message: "error trying to connect: tcp connect error: Connection refused (os error 61)", source: Some(tonic::transport::Error(Transport, hyper::Error(Connect, ConnectError("tcp connect error", Os { code: 61, kind: ConnectionRefused, message: "Connection refused" })))) }
...

  0 passing (59s)
  4 failing
Environment/Versions
  • OS and processor: M1 Mac
  • Temporal Version:
$ node --version
v18.18.2
$ npm --version
9.8.1
$ npm list @temporalio/client
temporal-activities-examples@0.1.0 /Users/markan/samples-typescript/activities-examples
├── @temporalio/client@1.9.3
├─┬ @temporalio/testing@1.9.3
│ └── @temporalio/client@1.9.3 deduped
└─┬ @temporalio/worker@1.9.3
  └── @temporalio/client@1.9.3 deduped
  • Are you using Docker or Kubernetes or building Temporal from source? N/A, I'm just trying to run the example test from this repo
Additional context

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the example tests in activities-examples/src/mocha and run npm install followed by npm test. Investigate why TestWorkflowEnvironment cannot establish its gRPC connection in the reported setup. Done means the example tests execute successfully without Connection Refused errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
node.js, typescript
Domain
testing
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.