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 parallel feature: disable parallel automatically/ add command line option #4428

Closed
wants to merge 4 commits into from

Conversation

stoicchild8910
Copy link

@stoicchild8910 stoicchild8910 commented Aug 29, 2020

Requirements

  • Filling out the template is required. Any pull request that does not include enough information to be reviewed in a timely manner may be closed at the maintainers' discretion.
  • All new code requires tests to ensure against regressions.

Description of the Change

This PR comes from the idea #4322
AS-IS
[single run]
parallelrun
[parallel run]
singlerun

(1) fix parallel feature : When running a single file, disable parallel mode automatically.

If we run only a single file in parallel mode, it is much slower.
So I added a feature to automate swap from parallel mode to single mode when we're running a single file.

(2) Added Command Line Option: added an option to FORCE PARALLEL MODE in (1) situation

Alternate Designs

Why should this be in core?

Benefits

When running a single file, Mocha automatically run in a faster way.

Possible Drawbacks

There must be a way to force parallel mode when running a single file if needed.

Applicable issues

@jsf-clabot
Copy link

jsf-clabot commented Aug 29, 2020

CLA assistant check
All committers have signed the CLA.

@stoicchild8910 stoicchild8910 changed the title add feature: "automatically disable" parallel mode if running a single file Add feature: Automatically disable parallel mode if running a single file Aug 29, 2020
@stoicchild8910 stoicchild8910 changed the title Add feature: Automatically disable parallel mode if running a single file fix parallel feature && added commandline option : (1)Automatically disable parallel mode if running a single file (2) added parallel force option Aug 29, 2020
@stoicchild8910 stoicchild8910 changed the title fix parallel feature && added commandline option : (1)Automatically disable parallel mode if running a single file (2) added parallel force option Fix parallel feature: disable parallel automatically/ add command line option Aug 29, 2020
@outsideris outsideris added type: feature enhancement proposal area: parallel mode Regarding parallel mode labels Aug 30, 2020
@stoicchild8910
Copy link
Author

I'm working on failed test cases!

@stoicchild8910
Copy link
Author

I am still working on test cases and PRs.

Copy link
Contributor

@boneskull boneskull left a comment

Choose a reason for hiding this comment

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

Thanks for the PR!

In general, I agree with this--Mocha should not run in parallel if there is only a single file, and we need a way to force it to run in parallel. This will affect many of our tests, as you have probably discovered. A way to address this is to detect --parallel in the arguments (see test/integration/helpers.js) and append --force-parallel to it. I would prefer the option is called --force-parallel, not --parallel-force.

@boneskull boneskull added the area: usability concerning user experience or interface label Sep 2, 2020
@boneskull
Copy link
Contributor

I am unsure if this would be a breaking change. Ideally, it would not have any impact on consumers, but... you never know.
@mochajs/core thoughts?

@boneskull boneskull marked this pull request as draft September 2, 2020 19:49
@boneskull
Copy link
Contributor

Please mark this PR as "ready" when the tests are passing

@stoicchild8910
Copy link
Author

Please mark this PR as "ready" when the tests are passing
Thank you for your opinion!

I also don't think many customers would run a single file in parallel option.
And that's the point where I thought to predict running time and automatize running mode.
For example we can test on many different files and how much time it needs to run -> if we have our standard we can automize running mode.
This is just my opinion!

And I will do mark PR when test passed.

@boneskull
Copy link
Contributor

@stoicchild8910

I also don't think many customers would run a single file in parallel option.

right, consumers may not, but Mocha needs to do so in order to efficiently test parallel mode. so this is why I'd want --force-parallel

@JoshuaKGoldberg
Copy link
Member

👋 coming back to this @stoicchild8910, are you still interested in working on this PR? As of #5027 there are again maintainers who can review it now. No worries if you no longer have time - but if you do that'd be great!

@JoshuaKGoldberg JoshuaKGoldberg added the status: waiting for author waiting on response from OP - more information needed label Mar 1, 2024
@JoshuaKGoldberg JoshuaKGoldberg added the stale this has been inactive for a while... label Jul 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: parallel mode Regarding parallel mode area: usability concerning user experience or interface stale this has been inactive for a while... status: waiting for author waiting on response from OP - more information needed type: feature enhancement proposal
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants