test: add reproduction case for missing AbortSignal reason#7443
Open
Janaka66 wants to merge 3 commits intoaxios:v1.xfrom
Open
test: add reproduction case for missing AbortSignal reason#7443Janaka66 wants to merge 3 commits intoaxios:v1.xfrom
Janaka66 wants to merge 3 commits intoaxios:v1.xfrom
Conversation
Contributor
There was a problem hiding this comment.
1 issue found across 1 file
Confidence score: 4/5
- This PR looks safe to merge overall; the only issue is a low-severity flaky test risk rather than product behavior.
test/unit/abort-reason.spec.jscan intermittently fail because a real network request to a private IP may error before the 10ms abort, yielding a different error than expected.- Pay close attention to
test/unit/abort-reason.spec.js- mitigate the race between network failure and abort to reduce flakiness.
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="test/unit/abort-reason.spec.js">
<violation number="1" location="test/unit/abort-reason.spec.js:10">
P2: Test is flaky because it uses a real network request to a private IP and races it against a 10ms abort; the connection can fail immediately before aborting, yielding a network error instead of ERR_CANCELED.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🧪 Failing Test Case: Abort Reason Propagation
I have added a unit test that demonstrates how
AxiosErrorfails to propagate the specific reason from anAbortController.The Bug:
When a request is aborted with a specific reason (e.g.,
TimeoutError), Axios currently defaults the error message to'canceled'instead of using the provided reason.Test Outcome
test/unit/abort-reason.spec.jsAssertionError [ERR_ASSERTION]: Expected values to be strictly equal'canceled''TimeoutError'🛠 Next Steps
I am currently working on the fix in
lib/core/dispatchRequest.js(or relevant adapter) to ensure thereasonproperty from theAbortSignalis correctly passed to theCanceledErrorconstructor.Summary by cubic
Adds a failing unit test to reproduce missing AbortSignal.reason propagation in Axios. It shows CanceledError uses "canceled" instead of the provided reason.
Description
Docs
Testing
Written for commit 96bf5e3. Summary will update on new commits.