Skip to content

Conversation

@bizob2828
Copy link
Member

Description

In #3503 we updated the MessageConsumerSubscriber to properly end transactions that were creating during the consumption of a message.
However, we didn't have proper test coverage to ensure that if a consumption message callback was a promise that it would properly wait for the
promise to resolve before ending the transaction. This PR fixes that.

How to Test

npm run versioned:internal:major amqplib

Related Issues

Closes #3509

Copy link
Contributor

@jsumners-nr jsumners-nr left a comment

Choose a reason for hiding this comment

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

I think we need to be a bit more generic in our detection and handling. We'll also need to rebase in order to get the AWS tests working.

@codecov
Copy link

codecov bot commented Nov 17, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.64%. Comparing base (df27448) to head (6b33450).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3510      +/-   ##
==========================================
- Coverage   97.77%   97.64%   -0.13%     
==========================================
  Files         420      420              
  Lines       55711    55724      +13     
  Branches        1        1              
==========================================
- Hits        54472    54414      -58     
- Misses       1239     1310      +71     
Flag Coverage Δ
integration-tests-cjs-20.x 73.90% <29.41%> (-0.01%) ⬇️
integration-tests-cjs-22.x 73.94% <29.41%> (-0.01%) ⬇️
integration-tests-cjs-24.x 74.70% <29.41%> (-0.02%) ⬇️
integration-tests-esm-20.x 52.50% <29.41%> (-0.01%) ⬇️
integration-tests-esm-22.x 52.55% <29.41%> (-0.01%) ⬇️
integration-tests-esm-24.x 53.75% <29.41%> (-0.01%) ⬇️
unit-tests-20.x 88.67% <47.05%> (-0.03%) ⬇️
unit-tests-22.x 88.71% <47.05%> (-0.02%) ⬇️
unit-tests-24.x 88.72% <47.05%> (-0.02%) ⬇️
versioned-tests-20.x 81.03% <100.00%> (-0.30%) ⬇️
versioned-tests-22.x 81.02% <100.00%> (-0.31%) ⬇️
versioned-tests-24.x ?

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@bizob2828 bizob2828 merged commit 45667a0 into newrelic:main Nov 17, 2025
24 of 25 checks passed
@bizob2828 bizob2828 deleted the consumer-fix branch November 17, 2025 14:11
@github-project-automation github-project-automation bot moved this from Needs PR Review to Done: Issues recently completed in Node.js Engineering Board Nov 17, 2025
@github-actions github-actions bot mentioned this pull request Nov 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done: Issues recently completed

Development

Successfully merging this pull request may close these issues.

Regression for async consumers withamqplib

2 participants