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(core): Aborting manual trigger tests should call closeFunction #9980

Merged
merged 2 commits into from
Jul 10, 2024

Conversation

netroy
Copy link
Member

@netroy netroy commented Jul 9, 2024

Summary

When a trigger node is being tested, the node returns a closeFunction method to do all the cleanup after the node has been triggered by an external message. However if the user stops the node before it has been triggered, closeFunction was not being called, leaving behind dangling connections and consumers, which could lead to these dangling consumers picking up messages, but not being able to process them correctly.
This PR changes Workflow.runNode to automatically call closeFunction when the trigger execution is aborted.

Related Linear tickets, Github issues, and Community forum posts

#8871
NODE-1230

Review / Merge checklist

  • PR title and summary are descriptive
  • Tests included

@n8n-assistant n8n-assistant bot added core Enhancement outside /nodes-base and /editor-ui n8n team Authored by the n8n team labels Jul 9, 2024
Copy link

cypress bot commented Jul 9, 2024

6 flaky tests on run #5854 ↗︎

0 399 0 0 Flakiness 6

Details:

🌳 🖥️ browsers:node18.12.0-chrome107 🤖 netroy 🗃️ e2e/*
Project: n8n Commit: b6977e6b48
Status: Passed Duration: 05:34 💡
Started: Jul 9, 2024 4:53 PM Ended: Jul 9, 2024 4:59 PM
Flakiness  5-ndv.cy.ts • 3 flaky tests

View Output Video

Test Artifacts
NDV > should not retrieve remote options when required params throw errors Screenshots Video
NDV > should retrieve remote options when non-required params throw errors Screenshots Video
NDV > Stop listening for trigger event from NDV Screenshots Video
Flakiness  10-undo-redo.cy.ts • 1 flaky test

View Output Video

Test Artifacts
Undo/Redo > should undo/redo adding connected nodes Test Replay Screenshots Video
Flakiness  12-canvas-actions.cy.ts • 1 flaky test

View Output Video

Test Artifacts
Canvas Actions > Node hover actions > should execute node Test Replay Screenshots Video
Flakiness  20-workflow-executions.cy.ts • 1 flaky test

View Output Video

Test Artifacts
Current Workflow Executions > should auto load more items if there is space and auto scroll Test Replay Screenshots Video

Review all test suite changes for PR #9980 ↗︎

Copy link
Contributor

github-actions bot commented Jul 9, 2024

✅ All Cypress E2E specs passed

Copy link
Contributor

github-actions bot commented Jul 9, 2024

✅ All Cypress E2E specs passed

@netroy netroy merged commit 6107798 into master Jul 10, 2024
48 checks passed
@netroy netroy deleted the fix-NODE-1230-manual-triggers branch July 10, 2024 10:37
@janober
Copy link
Member

janober commented Jul 10, 2024

Got released with [email protected]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Enhancement outside /nodes-base and /editor-ui n8n team Authored by the n8n team Released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants