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: make sure app ready on parallel mode #155

Merged
merged 1 commit into from Jan 30, 2023
Merged

Conversation

fengmk2
Copy link
Member

@fengmk2 fengmk2 commented Jan 30, 2023

Checklist
  • npm test passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines
Affected core subsystem(s)
Description of change

@fengmk2 fengmk2 added the bug label Jan 30, 2023
@fengmk2 fengmk2 requested a review from killagu January 30, 2023 02:14
@fengmk2 fengmk2 marked this pull request as ready for review January 30, 2023 02:14
Copy link
Contributor

@killagu killagu left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -47,6 +47,9 @@ exports.getApp = async suite => {
if (getAppCallback) {
return getAppCallback(suite);
}
if (app) {
await app.ready();
Copy link
Contributor

Choose a reason for hiding this comment

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

是哪里用的时候没有 await ready?

Copy link
Member Author

Choose a reason for hiding this comment

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

runSuite 里面 await 了这个 proxy app,会直接卡住 https://github.com/eggjs/egg-mock/blob/master/lib/inject_context.js#L22

Copy link
Contributor

Choose a reason for hiding this comment

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

应该会走到 get then 返回 undefined。会卡住能重现吗?

Copy link
Member Author

Choose a reason for hiding this comment

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

可以的,egg-bin 里面那个并行测试用例必现。

@codecov
Copy link

codecov bot commented Jan 30, 2023

Codecov Report

Base: 85.46% // Head: 85.49% // Increases project coverage by +0.02% 🎉

Coverage data is based on head (5c166c6) compared to base (5e3e816).
Patch coverage: 87.50% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #155      +/-   ##
==========================================
+ Coverage   85.46%   85.49%   +0.02%     
==========================================
  Files          27       27              
  Lines        2546     2550       +4     
  Branches      454      455       +1     
==========================================
+ Hits         2176     2180       +4     
  Misses        370      370              
Impacted Files Coverage Δ
lib/parallel/agent.js 27.69% <ø> (+0.21%) ⬆️
lib/app_handler.js 68.96% <80.00%> (-0.13%) ⬇️
lib/inject_context.js 94.39% <100.00%> (+0.10%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@fengmk2 fengmk2 merged commit 83c600e into master Jan 30, 2023
@fengmk2 fengmk2 deleted the make-sure-app-ready branch January 30, 2023 02:20
fengmk2 pushed a commit that referenced this pull request Jan 30, 2023
[skip ci]

## [5.10.2](v5.10.1...v5.10.2) (2023-01-30)

### Bug Fixes

* make sure app ready on parallel mode ([#155](#155)) ([83c600e](83c600e))
@github-actions
Copy link

🎉 This PR is included in version 5.10.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants