samples-typescript icon indicating copy to clipboard operation
samples-typescript copied to clipboard

[Bug] The DSL example seems incorrect

Open tdeebswihart opened this issue 1 year ago • 0 comments

What are you really trying to do?

Run our DSL example and verify that it successfully executes the specified sequence of activities.

Describe the bug

There are a few problems with it

  1. Our docs are wrong and mention workflow outputs that don't exist (we return nothing from our workflows)
  2. It doesn't fully execute the DLS specified by the workflowN.yaml file

workflow1.yaml specifies a sequence of three activities that should be executed but we only execute the first two (see reproduction below). The docs also show this: they contain an example output that only shows the first two activities being executed.

workflow2.yaml exhibits the same problem: it runs two sequences in parallel and the final activity of each sequence is not executed. You'll see neither activity3 nor activity5 execute.

Minimal Reproduction

Run workflow1 of the DSL workflow:

# Run worker
$ npm start &
$ npm run workflow1

Worker logs:

<SNIP>
2024-02-23T22:40:13.586Z [INFO] Worker state changed { state: 'RUNNING' }
2024-02-23T22:42:09.274Z [INFO] Executing activity1 {
  isLocal: false,
  attempt: 1,
  namespace: 'default',
  taskToken: 'CiRhM2MyMzFjZi1lZTk5LTQyNTUtOWE4Mi0zMzU5ZDBkOTMxYTESCW15LWRzbC1pZBokMGNlOTE0MjgtNGQwZS00MDA4LTlmNzItZDEwYWI4NWVmYzAyIAUoATIBMUIJYWN0aXZpdHkxSgkIAhDniYABGAE=',
  workflowId: 'my-dsl-id',
  workflowRunId: '0ce91428-4d0e-4008-9f72-d10ab85efc02',
  workflowType: 'DSLInterpreter',
  activityId: '1',
  activityType: 'activity1',
  taskQueue: 'dsl-interpreter',
  arg1: 'value1'
}
2024-02-23T22:42:09.304Z [INFO] Executing activity2 {
  isLocal: false,
  attempt: 1,
  namespace: 'default',
  taskToken: 'CiRhM2MyMzFjZi1lZTk5LTQyNTUtOWE4Mi0zMzU5ZDBkOTMxYTESCW15LWRzbC1pZBokMGNlOTE0MjgtNGQwZS00MDA4LTlmNzItZDEwYWI4NWVmYzAyIAsoATIBMkIJYWN0aXZpdHkySgkIAhD3iYABGAE=',
  workflowId: 'my-dsl-id',
  workflowRunId: '0ce91428-4d0e-4008-9f72-d10ab85efc02',
  workflowType: 'DSLInterpreter',
  activityId: '2',
  activityType: 'activity2',
  taskQueue: 'dsl-interpreter',
  arg: '[result from activity1: value1]'
}

Workflow output:

undefined

Environment/Versions

  • OS and processor: M1 Mac
  • Temporal Version: Server version 1.22.5, SDK version 1.9.1
  • Are you using Docker or Kubernetes or building Temporal from source? I'm building temporal from source

tdeebswihart avatar Feb 23 '24 22:02 tdeebswihart

Internal notes

The error returned by the Test server is “incorrect” with regards to the official server…

That explains the "Network error" message, but not why the workflow is able to continue forward with the official server, but not with the time skipping test server. In both case, the server should deny the WFT Completion anyway, and core will evict the workflow in both cases.

An hypothesis is that the test server might fail to send a subsequent WFT for some reason.

mjameswh avatar Feb 17 '23 15:02 mjameswh

Watching this issue; right now we're able to write tests for our no-sleep workflows, but not workflows that sleep.

josiah-roberts avatar Feb 22 '23 01:02 josiah-roberts