-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Issue 2262 ES imports in parallel #2263
base: main
Are you sure you want to change the base?
Issue 2262 ES imports in parallel #2263
Conversation
There is a behavior change in that the step files resolve simultaneously, but I can't imagine it mattering because Cucumber never gave the end users a way to control the order their step files are resolved in. This might be a concern so I sharded this optimization off to it's own PR for review. |
@davidjgoss raised the important point that there may be code out there relying on this sequential load behavior. I'm not so sure this is the case, but that is the safest approach to this optimization. That would mean delaying this to the next major release and/or using a cli or config flag to allow opt in. I'm inclined to follow David's advice and just defer to the next major, especially since require imports are going to remain sequential as that is the nature of the beast. Also, the optimization isn't worth the headache except perhaps for the very largest of test libraries. |
To be clear I do think this is the right thing to do. With |
Agreed, so flag for version 10 and I'll come back to this when work on that major starts to catch up anything that fell behind? How do I do that or do you want to do it? |
Noting that this would, as it stands, break the parallel runtime because that depends on support code being registered in a consistent order across coordinator and workers. We'll need to try and find another way around that in order to go ahead with this change. |
🤔 What's changed?
Optimization in the support.ts file to gather the dynamic import Promises into an array and then resolve them with a single Promise.all() call.
⚡️ What's your motivation?
This should yield a noticeable speedup on Cucumber installs with very large ES step definition libraries. Other Cucumber installs will be unaffected.
🏷️ What kind of change is this?
♻️ Anything particular you want feedback on?
If there are other instances in the codebase where an await is inside a loop then this pattern should be applied there as well.
📋 Checklist: