zeebe-spec icon indicating copy to clipboard operation
zeebe-spec copied to clipboard

Job workers don't stop in reusable Zeebe environment

Open saig0 opened this issue 4 years ago • 0 comments

Describe the bug With the Zeebe worker, I can use a reusable environment to reduce the test execution time.

In a specification, I can have test cases that define a complete-task for the same task but with different variables. Currently, it can happen that the task is completed with the variables of the previous test case.

To Reproduce

Run the following spec in a reusable environment (e.g. io.zeebe.bpmnspec.junit.BpmnSpecExtensionReuseEnvironmentTest)

resources:
  - exclusive-gateway.bpmn

testCases:
  - name: condition-flow
    description: the condition is fulfilled
    actions:
      - action: create-instance
        args:
          bpmn_process_id: exclusive-gateway
          workflow_instance_alias: wf-1
      - action: complete-task
        args:
          job_type: a
          variables: '{"x":8}'

    verifications:
      - verification: element-instance-state
        args:
          element_name: B
          state: activated
          workflow-instance: wf-1

  - name: default-flow
    description: take the default flow
    actions:
      - action: create-instance
        args:
          bpmn_process_id: exclusive-gateway
          workflow_instance_alias: wf-2
      - action: complete-task
        args:
          job_type: a
          variables: '{"x":3}'

    verifications:
      - verification: element-instance-state
        args:
          element_name: C
          state: activated
          workflow-instance: wf-2

Expected behavior The task worker from the previous test case is closed and doesn't influence the next test case.

Additional context

saig0 avatar Jul 09 '21 12:07 saig0