test: improve port handling stability in api.test.js#5433
test: improve port handling stability in api.test.js#5433alexander-akait merged 7 commits intowebpack:masterfrom
Conversation
|
Hello @alexander-akait, can you review this PR? I'm not sure if this is the correct way to resolve the unstable test cases, can you tell me your thoughts about it? |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #5433 +/- ##
==========================================
- Coverage 90.29% 83.38% -6.92%
==========================================
Files 15 13 -2
Lines 1577 2028 +451
Branches 601 745 +144
==========================================
+ Hits 1424 1691 +267
- Misses 140 303 +163
- Partials 13 34 +21 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| `Skipping test due to permission issues: ${error.message}`, | ||
| ); | ||
| return; | ||
| } |
There was a problem hiding this comment.
I added that because,
- Without this handling, tests sometimes fail unpredictably with "permission denied" errors which occurs due to Windows environments often having stricter port access permissions.
- These failures block CI pipelines despite the actual code being correct.
There was a problem hiding this comment.
I am afraid it can create flaky tests, i.e. we will have green CI, but tests are failed, let's rewrite it - try to test 3 times, if failed our CI should failed
|
And @alexander-akait, one request whenever you are free can you please take a look at my proposal for GSOC 2025? Any pointers on what I could change, improve or modify will be very helpful for me. |
|
@negimox Unfortunately, I don't work with proposals, other developers from our TCS (you can find them on webpack readme page) are doing this |
Hello @alexander-akait , I'll take a look at the webpack readme page and reach out to the appropriate team members. If you have any tips on who to contact first, that would be really helpful! But thank you for responding. |
|
@alexander-akait I have changed its functionality to retry 3 times. Could you verify if this implementation correct for retry? |
alexander-akait
left a comment
There was a problem hiding this comment.
Can you fix it for all tests? Because we have the same logic for other tests
Yes, I can do that. Should I start a new PR for that? |
|
@negimox I mean fix it for all test in this file |
|
Hello, @alexander-akait I have implemented the same for the other test cases. Could you please verify and check? Thank you. |
|
@negimox Code is good, but still fail on CI ( Can you look too? |
|
Hello @alexander-akait, hope you are doing well. I have updated the branch to resolve the Lint errors, but currently it throws a security audit error: It's for the package, "http-proxy-middleware" currently at "^2.0.7" version. What should be the next steps now? |
|
@negimox Let's update this in other PR, here is everything fine |
|
@negimox Thank you |
|
@negimox Feel free to update our deps where it is possible to avoid security reporting |
For Bugs and Features; did you add new tests?
Motivation / Use-Case
The test file api.test.js is unstable when "PORT" access isn't available, which results in the test suite failing.
Breaking Changes
Additional Info