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

Fix flaky EmbeddedSubProcessTest #12697

Merged
merged 1 commit into from May 9, 2023
Merged

Fix flaky EmbeddedSubProcessTest #12697

merged 1 commit into from May 9, 2023

Conversation

remcowesterhoud
Copy link
Contributor

@remcowesterhoud remcowesterhoud commented May 8, 2023

Description

The test was flaky because it could occur that the messages got published before the subscription were opened. As the messages have no TTL this means they were not getting correlated, as expected.

Log of a failing run:

C DPLY         CREATE            - #01-> -1  -1 - 
E PROC         CREATED           - #02->#01 K01 - process.xml -> "process..process" (version:1)
E DPLY         CREATED           - #03->#01 K02 - process.xml
E DPLY         FULLY_DISTRIBUTED - #04->#01 K02 - 
C CREA         CREATE            - #05-> -1  -1 - new <process "process..process"> with variables: {correlationKey=correlationKey}
E VAR          CREATED           - #06->#05 K04 - correlationKey->"correlationKey" in <process [K03]>
C PI           ACTIVATE          - #07->#05 K03 - PROCESS "process..process" in <process "process..process"[K03]>
E CREA         CREATED           - #08->#05 K05 - new <process "process..process"> with variables: {correlationKey=correlationKey}
E PI           ACTIVATING        - #09->#07 K03 - PROCESS "process..process" in <process "process..process"[K03]>
E PI           ACTIVATED         - #10->#07 K03 - PROCESS "process..process" in <process "process..process"[K03]>
C PI           ACTIVATE          - #11->#07  -1 - START_EVENT "startEv..8897acc" in <process "process..process"[K03]>
E PI           ACTIVATING        - #12->#11 K06 - START_EVENT "startEv..8897acc" in <process "process..process"[K03]>
E PI           ACTIVATED         - #13->#11 K06 - START_EVENT "startEv..8897acc" in <process "process..process"[K03]>
C PI           COMPLETE          - #14->#11 K06 - START_EVENT "startEv..8897acc" in <process "process..process"[K03]>
E PI           COMPLETING        - #15->#14 K06 - START_EVENT "startEv..8897acc" in <process "process..process"[K03]>
E PROC_MSG_SUB CREATING          - #16->#14 K07 - "eventSubProcess" (inter.) correlationKey: correlationKey @[K03] in <process "process..process"[K03]> (no vars)
E PI           COMPLETED         - #17->#14 K06 - START_EVENT "startEv..8897acc" in <process "process..process"[K03]>
E PI           SEQ_FLOW_TAKEN    - #18->#14 K08 - SEQUENCE_FLOW "sequenc..b7cb1a6" in <process "process..process"[K03]>
C PI           ACTIVATE          - #19->#14 K09 - SUB_PROCESS "subProcess" in <process "process..process"[K03]>
E PI           ACTIVATING        - #20->#19 K09 - SUB_PROCESS "subProcess" in <process "process..process"[K03]>
E PI           ACTIVATED         - #21->#19 K09 - SUB_PROCESS "subProcess" in <process "process..process"[K03]>
C PI           ACTIVATE          - #22->#19  -1 - START_EVENT "startEv..8b12a7c" in <process "process..process"[K03]>
E PI           ACTIVATING        - #23->#22 K10 - START_EVENT "startEv..8b12a7c" in <process "process..process"[K03]>
E PI           ACTIVATED         - #24->#22 K10 - START_EVENT "startEv..8b12a7c" in <process "process..process"[K03]>
C PI           COMPLETE          - #25->#22 K10 - START_EVENT "startEv..8b12a7c" in <process "process..process"[K03]>
E PI           COMPLETING        - #26->#25 K10 - START_EVENT "startEv..8b12a7c" in <process "process..process"[K03]>
E PROC_MSG_SUB CREATING          - #27->#25 K11 - "boundary" (inter.) correlationKey: correlationKey @[K09] in <process "process..process"[K03]> (no vars)
E PI           COMPLETED         - #28->#25 K10 - START_EVENT "startEv..8b12a7c" in <process "process..process"[K03]>
E PI           SEQ_FLOW_TAKEN    - #29->#25 K12 - SEQUENCE_FLOW "sequenc..8c72ad0" in <process "process..process"[K03]>
C PI           ACTIVATE          - #30->#25 K13 - SERVICE_TASK "task" in <process "process..process"[K03]>
E PI           ACTIVATING        - #31->#30 K13 - SERVICE_TASK "task" in <process "process..process"[K03]>
E JOB          CREATED           - #32->#30 K14 - K14 "task" @"task"[K13] 3 retries, in <process "process..process"[K03]> (no vars)
E PI           ACTIVATED         - #33->#30 K13 - SERVICE_TASK "task" in <process "process..process"[K03]>
C MSG          PUBLISH           - #34-> -1 K01 - "boundary" correlationKey: correlationKey (no vars)
C MSG          PUBLISH           - #35-> -1 K01 - "eventSubProcess" correlationKey: correlationKey (no vars)
E MSG          PUBLISHED         - #36->#34 K15 - "boundary" correlationKey: correlationKey (no vars)
E MSG          EXPIRED           - #37->#34 K15 - "boundary" correlationKey: correlationKey (no vars)
E MSG          PUBLISHED         - #38->#35 K16 - "eventSubProcess" correlationKey: correlationKey (no vars)
E MSG          EXPIRED           - #39->#35 K16 - "eventSubProcess" correlationKey: correlationKey (no vars)
C MSG_SUB      CREATE            - #40-> -1  -1 - "eventSubProcess" (inter.) correlationKey: correlationKey @[K03] in <process "process..process"[K03]> (no vars)
C MSG_SUB      CREATE            - #41-> -1  -1 - "boundary" (inter.) correlationKey: correlationKey @[K09] in <process "process..process"[K03]> (no vars)
E MSG_SUB      CREATED           - #42->#40 K17 - "eventSubProcess" (inter.) correlationKey: correlationKey @[K03] in <process "process..process"[K03]> (no vars)
C PROC_MSG_SUB CREATE            - #43-> -1  -1 - "eventSubProcess" (inter.) @[K03] in <process ?[K03]> (no vars)
E MSG_SUB      CREATED           - #44->#41 K18 - "boundary" (inter.) correlationKey: correlationKey @[K09] in <process "process..process"[K03]> (no vars)
C PROC_MSG_SUB CREATE            - #45-> -1  -1 - "boundary" (inter.) @[K09] in <process ?[K03]> (no vars)
E PROC_MSG_SUB CREATED           - #46->#43 K07 - "eventSubProcess" (inter.) correlationKey: correlationKey @[K03] in <process "process..process"[K03]> (no vars)
E PROC_MSG_SUB CREATED           - #47->#45 K11 - "boundary" (inter.) correlationKey: correlationKey @[K09] in <process "process..process"[K03]> (no vars)

The test isn't really flaky on 8.2+ anymore. This is a result of batch processing that was introduced recently. However, I believe it's still good to fix it on all versions and keep the test aligned across versions.

Related issues

closes #11844

Definition of Done

Not all items need to be done depending on the issue and the pull request.

Code changes:

  • The changes are backwards compatibility with previous versions
  • If it fixes a bug then PRs are created to backport the fix to the last two minor versions. You can trigger a backport by assigning labels (e.g. backport stable/1.3) to the PR, in case that fails you need to create backports manually.

Testing:

  • There are unit/integration tests that verify all acceptance criterias of the issue
  • New tests are written to ensure backwards compatibility with further versions
  • The behavior is tested manually
  • The change has been verified by a QA run
  • The impact of the changes is verified by a benchmark

Documentation:

  • The documentation is updated (e.g. BPMN reference, configuration, examples, get-started guides, etc.)
  • If the PR changes how BPMN processes are validated (e.g. support new BPMN element) then the Camunda modeling team should be informed to adjust the BPMN linting.

Other teams:
If the change impacts another team an issue has been created for this team, explaining what they need to do to support this change.

Please refer to our review guidelines.

The test was flaky because it could occur that the messages got published before the subscription were opened.
As the messages have no TTL this means they were not getting correlated, as expected.
Copy link
Member

@koevskinikola koevskinikola left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀

bors merge

@zeebe-bors-camunda
Copy link
Contributor

Build succeeded:

@zeebe-bors-camunda zeebe-bors-camunda bot merged commit 0458119 into main May 9, 2023
36 checks passed
@zeebe-bors-camunda zeebe-bors-camunda bot deleted the 11844_flaky_test branch May 9, 2023 07:09
@backport-action
Copy link
Collaborator

Backport failed for stable/8.0, because it was unable to cherry-pick the commit(s).

Please cherry-pick the changes locally.

git fetch origin stable/8.0
git worktree add -d .worktree/backport-12697-to-stable/8.0 origin/stable/8.0
cd .worktree/backport-12697-to-stable/8.0
git checkout -b backport-12697-to-stable/8.0
ancref=$(git merge-base 46cd2fae7fb0b770a5be6f9204b300891ee3077c cb26d2c2eeb684bfe53dfd4f1f9b513f289fbea8)
git cherry-pick -x $ancref..cb26d2c2eeb684bfe53dfd4f1f9b513f289fbea8

@backport-action
Copy link
Collaborator

Successfully created backport PR for stable/8.1:

@backport-action
Copy link
Collaborator

Successfully created backport PR for stable/8.2:

zeebe-bors-camunda bot added a commit that referenced this pull request May 9, 2023
12718: [Backport stable/8.1] Fix flaky `EmbeddedSubProcessTest` r=remcowesterhoud a=backport-action

# Description
Backport of #12697 to `stable/8.1`.

relates to #11844

Co-authored-by: Remco Westerhoud <remco@westerhoud.nl>
zeebe-bors-camunda bot added a commit that referenced this pull request May 9, 2023
12719: [Backport stable/8.2] Fix flaky `EmbeddedSubProcessTest` r=remcowesterhoud a=backport-action

# Description
Backport of #12697 to `stable/8.2`.

relates to #11844

Co-authored-by: Remco Westerhoud <remco@westerhoud.nl>
zeebe-bors-camunda bot added a commit that referenced this pull request May 10, 2023
12721: [Backport stable/8.0] Fix flaky `EmbeddedSubProcessTest` r=remcowesterhoud a=remcowesterhoud

# Description
Backport of #12697 to `stable/8.0`.

relates to #11844

Co-authored-by: Remco Westerhoud <remco@westerhoud.nl>
@oleschoenburg oleschoenburg added the version:8.2.5 Marks an issue as being completely or in parts released in 8.2.5 label May 16, 2023
@oleschoenburg oleschoenburg added version:8.1.13 Marks an issue as being completely or in parts released in 8.1.13 release/8.0.16 labels Jun 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport stable/8.2 Backport a pull request to 8.2.x version:8.1.13 Marks an issue as being completely or in parts released in 8.1.13 version:8.2.5 Marks an issue as being completely or in parts released in 8.2.5
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unstable test EmbeddedSubProcessTest.shouldNotTriggerBoundaryEventWhenFlowscopeIsInterrupted
4 participants